Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/code4mk/terraform-terragrunt-aws-template
production ready multi enviornment terraform template for aws
https://github.com/code4mk/terraform-terragrunt-aws-template
sdeops terraform terraform-aws terraform-boilerplate terraform-template terraform-terragrunt terragrunt terragrunt-aws terrant
Last synced: about 1 month ago
JSON representation
production ready multi enviornment terraform template for aws
- Host: GitHub
- URL: https://github.com/code4mk/terraform-terragrunt-aws-template
- Owner: code4mk
- Created: 2024-06-29T20:37:38.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T21:20:47.000Z (4 months ago)
- Last Synced: 2024-09-10T21:14:16.147Z (3 months ago)
- Topics: sdeops, terraform, terraform-aws, terraform-boilerplate, terraform-template, terraform-terragrunt, terragrunt, terragrunt-aws, terrant
- Language: HCL
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-terragrunt-aws-project
# File structure
```bash
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
```---
# Run locally
## update config file
The `config.json` file contains essential configurations for Terraform and Terragrunt. You should update this file to match your environment and branch-specific settings.## cli command
```bash
./run.sh
```# Run GitHub Action (Terragrunt Plan and Apply)
## Setting Up GitHub Secrets
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.
## Update Config File
The `config.json` file contains essential configurations for Terraform and Terragrunt. You should update this file to match your environment and branch-specific settings.
### Config File Structure
Here is the format for `config.json`:
```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"
}
}
}