Skip to content

Repository to provision and manage Terraform Cloud projects using Terraform code (IaC).

License

Notifications You must be signed in to change notification settings

ConseilsTI/TerraformCloud-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Cloud Projects Factory

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).

Permissions

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.

Authentication

Terraform Cloud

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.

Hashicorp Vault Secrets Authentication

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.

Features

  • 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

Documentation

Requirements

The following requirements are needed by this module:

Modules

No modules.

Required Inputs

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

Optional Inputs

No optional inputs.

Resources

The following resources are used by this module:

Outputs

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.