Manage GitHub repositories and Terraform Cloud workspaces.
- Need to setup the AWS access configuration for each workspace.
- Need to record the various architecture decisions that have already been made when designing this code!
- Need to handle the TfC and GH tokens in the module, not in the main code.
We make use of a template in GitHub for all of our Terraform code moving forward.
The VCS integration between the Terraform Cloud Organization and our GitHub Organization must be configured and the OAuth Token ID must be captured as an input into this code.
The heavy lifting is in an embedded module named tfc_gh
. In the main section of code, each call to that module will create the following resources
- In GitHub
- a single repository
- In Terraform Cloud
- one workspace per "environment" (e.g.,
stage
orprod
ordev
) - VCS integration between the workspace and the repository
- initial values for the three variables without devaults (
ou
,name
,environment
)
- one workspace per "environment" (e.g.,
Name | Version |
---|---|
terraform | ~> 1.0 |
No providers.
Name | Source | Version |
---|---|---|
app1 | ./modules/tfc_gh | n/a |
creos | ./modules/tfc_gh | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
gh_token | The GitHub user token for the special MIT Libraries user account in github.com/MITLibraries | string |
n/a | yes |
tfc_oauth_token_id | The OAuth token id in Terraform Cloud for VCS integration | string |
n/a | yes |
tfc_token | The user token for the Terraform Cloud automation account. | string |
n/a | yes |
tfc_version | The version of Terraform to run in TfC | string |
n/a | yes |
No outputs.