Code which manages configuration and life-cycle of all the Terraform Cloud projects. It is designed to be used from a dedicated VCS-Driven Terraform Cloud workspace that would provision and manage the configuration using Terraform code (IaC).
To manage the Terraform Cloud projects from that code, provide a token from an
account with manage all projects
and manage teams
access. Alternatively, you
can use a token from a team with that access instead of a user token.
To manage secrets in Hashicorp Vault Secrets, provide a client ID and a key
from a service principals with the secret contributor
role.
The Terraform Cloud provider requires a Terraform Cloud/Enterprise API token in order to manage resources.
- Set the
TFE_TOKEN
environment variable: The provider can read the TFE_TOKEN environment variable and the token stored there to authenticate. Refer to Managing Variables documentation for more details.
The Hashicorp Vault Secrets provider requires a service principal client ID and a key in order to manage resources.
-
Set the
HCP_CLIENT_ID
environment variable: The provider can read the HCP_CLIENT_ID environment variable and the client ID stored there to authenticate. Refer to Managing Variables documentation for more details. -
Set the
HCP_CLIENT_SECRET
environment variable: The provider can read the HCP_CLIENT_SECRET environment variable and the client ID stored there to authenticate. Refer to Managing Variables documentation for more details.
- Manages configuration and life-cycle of Terraform Cloud resources:
- projects
- teams
- teams project access
- teams token
- Manages configuration and life-cycle of Hashicorp Vault Secrets
- secrets
The following requirements are needed by this module:
No modules.
The following input variables are required:
Description: (Required) The name of the Terraform Cloud organization.
Type: string
Description: (Required) A list of project names to create.
Type: list(string)
Description: (Required) The name of the application where the secret will be stored.
Type: string
No optional inputs.
The following resources are used by this module:
- hcp_vault_secrets_secret.this (resource)
- tfe_project.this (resource)
- tfe_team.this (resource)
- tfe_team_project_access.this (resource)
- tfe_team_token.this (resource)
The following outputs are exported:
Description: The project ID.
Description: The team resources attributes.
Description: The ID of the team.
Description: The team project access attributes.
This GitHub repository is manage through Terraform Code from TerraformCloud-Foundation repository.