Creates an empty GitHub repository (blank or from a specified template) and a corresponding workspace in Terraform Cloud.
After setting up the GitHub repo + TFC workspace, you must set a secret in your GitHub repo called TFC_API_TOKEN
and set its value to a personal token obtained from Terraform Cloud. This is required for the GitHub Action that runs Terraform on your behalf.
Name | Version |
---|---|
terraform | >= 1.0.0 |
github | >= 4.1.0 |
tfe | >= 0.26.1 |
Name | Version |
---|---|
github | 4.16.0 |
tfe | 0.26.1 |
No modules.
Name | Type |
---|---|
github_repository.blank | resource |
github_repository.templated | resource |
github_repository_file.blank_providers_tf | resource |
github_repository_file.templated_providers_tf | resource |
tfe_workspace.main | resource |
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 |
tfc_organization_name | The name of the Terraform Cloud organization to which the workspace belongs | string |
n/a | yes |
tfc_workspace_name | The name of the workspace in Terraform Cloud | string |
n/a | yes |
tfc_workspace_tags | A list of tags to assign to the workspace | list(string) |
[] |
no |
tfc_workspace_terraform_version | The version of Terraform to use during the workspace's runs | string |
n/a | yes |
Name | Description |
---|---|
github_repo_full_name | n/a |
github_templated_repo_full_name | n/a |
tfc_workspace_id | n/a |
tfc_workspace_name | n/a |
terraform {
required_version = "~> 1.0"
required_providers {
github = {
source = "integrations/github"
version = "~> 4.1"
}
tfe = {
source = "hashicorp/tfe"
version = "~> 0.26"
}
}
}
provider "github" {
token = "..."
}
provider "tfe" {
token = "..."
}
module "test" {
source = "github.com/fabiendelpierre/terraform-github-tfc-workspace-module"
github_repo_name = "foo"
github_repo_description = "..."
github_repo_use_template = true
github_repo_template_owner_name = "owner-org"
github_repo_template_repo_name = "template-repo-name"
tfc_workspace_name = "foo"
tfc_organization_name = "tfc-org-name"
tfc_workspace_terraform_version = "1.0.7"
}