terrafrom-terragrunt-aws-project
├── terragrunt.hcl
├── modules
│ ├── subnet
│ │ ├── main.tf
│ │ ├── output.tf
│ │ └── variables.tf
│ └── vpc
│ ├── main.tf
│ ├── output.tf
│ └── variables.tf
├── projects
│ ├── common
│ │ └── common-resources.tf
│ ├── stage
│ │ ├── modules (symlink with root modules via script)
│ │ ├── common-*.tf (symlink with common via script)
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── output.tf
│ └── prod
│ ├── modules (symlink with root modules via script)
│ ├── common-*.tf (symlink with common)
│ ├── main.tf
│ ├── variables.tf
│ └── output.tf
└── environment
├── stage
│ └── terragrunt.hcl
└── prod
└── terragrunt.hcl
The config.json
file contains essential configurations for Terraform and Terragrunt. You should update this file to match your environment and branch-specific settings.
./run.sh
To ensure that the GitHub Action workflow runs correctly, you need to set up the following GitHub secret:
TF_API_TOKEN
: This is a Terraform Cloud API token used for authentication.
The config.json
file contains essential configurations for Terraform and Terragrunt. You should update this file to match your environment and branch-specific settings.
Here is the format for config.json
:
{
"terraform_version": "1.8.0",
"terragrunt_version": "0.57.0",
"branches": {
"main": {
"TF_WORKSPACE": "prod-project",
"TG_WORKDIR": "environment/stage"
},
"stage": {
"TF_WORKSPACE": "stage-project",
"TG_WORKDIR": "environment/stage"
},
"dev": {
"TF_WORKSPACE": "dev-project",
"TG_WORKDIR": "environment/dev"
},
"default": {
"TF_WORKSPACE": "default",
"TG_WORKDIR": "environment/default"
}
}
}