Skip to content

A Terraform module to create a GitHub repository for a Terraform module from a template, and add the module to a Terraform Cloud private module registry

License

Notifications You must be signed in to change notification settings

fabiendelpierre/terraform-github-tfc-registry-module

Repository files navigation

terraform-github-tfc-registry-module

This module creates a GitHub repository (blank or from a template) and links the repo to a Terraform Cloud private module registry. It's intended to simplify the initial setup steps of a reusable TF module.

Inputs and outputs

Requirements

Name Version
terraform >= 1.0.0
github >= 4.1.0
tfe >= 0.26.1

Providers

Name Version
github 4.15.1
tfe 0.26.1

Modules

No modules.

Resources

Name Type
github_repository.blank resource
github_repository.templated resource
tfe_registry_module.blank resource
tfe_registry_module.templated resource

Inputs

Name Description Type Default Required
github_repo_description A description for the GitHub repo string "" no
github_repo_enable_issues value bool true no
github_repo_enable_projects value bool false no
github_repo_enable_wiki value bool false no
github_repo_gitignore_template A gitignore template to preinstall in the GitHub repo string "Terraform" no
github_repo_license_template The license to apply to the GitHub repository string "unlicense" no
github_repo_name The name of the GitHub repo string n/a yes
github_repo_template_owner_name The owner organization of the template repo to use to create this repo string "" no
github_repo_template_repo_name The name of the template repo to use to create this repo string "" no
github_repo_use_template Use a template to create the GitHub repo bool true no
github_repo_visibility The GitHub repo's visibility (public, private, or internal) string "public" no
oauth_token_id The OAuth token ID of the VCS connection to use by the TFC module registry to retrieve the module from source control string n/a yes

Outputs

Name Description
github_repo_full_name n/a
github_templated_repo_full_name n/a

Code example

provider "github" {
  token = "..."
}

provider "tfe" {
  token = "..."
}

module "foo" {
  source  = "github.com/fabiendelpierre/terraform-github-tfc-registry-module"

  github_repo_name        = "terraform-provider-foo"
  github_repo_description = "A Terraform module"

  github_repo_use_template        = true
  github_repo_template_owner_name = "owner-name"
  github_repo_template_repo_name  = "template-repo-name"
  oauth_token_id                  = data.tfe_oauth_client.oauth_client.oauth_token_id
}

About

A Terraform module to create a GitHub repository for a Terraform module from a template, and add the module to a Terraform Cloud private module registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages