Repository Setup & Usage Example
1
Clone the Infrastructure Repository
Begin by cloning your organization’s Fast Foundation infrastructure repository:
Replace
<your-fast-foundation-repo-url> with the actual repository URL provided by your team.2
Configure Provider Plugin Cache (optional, but strongly recommended)
By default,
terraform init downloads plugins into a subdirectory of the working directory so that each working directory is self-contained.
As a consequence, if you have multiple configurations that use the same provider then a separate copy of its plugin will be downloaded for each configuration.Given that provider plugins can be quite large (on the order of hundreds of megabytes), this default behavior can be inconvenient for those with slow or metered Internet connections.
Therefore Terraform optionally allows the use of a local directory as a shared plugin cache, which then allows each distinct plugin binary to be downloaded only once.More information can be found in the official terraform documentation.To enable the plugin cache:This directory must already exist before Terraform will cache plugins; Terraform will not create the directory itself.
If it does not exist, create it running
mkdir -p $HOME/.terraform.d/plugin-cache3
Initialize with Parameter Management
If you have admin permissions to the entire organization, you can initialize the entire repository from the root directory. If not, run this from an account or region folder. Initialize Terragrunt:What happens here:
The initialization process can take some minutes to finish.
- Terragrunt initializes the backend for all the units.
- Parameter management downloads S3
inputs.hclfiles.
- For each unit that is initialized, you should see:
If parameters differ between local and S3, you’ll see an error.
Move to the directory that has the parameter drift and use
TG_SECRETS=update (to pull S3 values) or TG_SECRETS=save (to overwrite with local values).4
Plan with Drift Detection
Review planned infrastructure changes while validating parameters.
Move into the workload-core-development account directory, we will use the clusters VPC as an example:If parameter drift is detected:
5
Apply with Parameter Safety
Apply the configuration to deploy the organization structure:On parameter drift, apply will block with an error:Resolve and retry:
Your organization and member accounts are now created with synchronized parameters.
Troubleshooting
Permission Errors
Permission Errors
Symptoms:
Access Denied errors during Terragrunt operations.Possible causes:- SSO (AWS IAM Identity Center) session expired.
- Misconfigured AWS profile.
- Missing IAM permissions.
- Verify your session:
aws sso login --sso-session fast-foundation - Check your profile in
~/.aws/config - Ensure your user/role has the required IAM permissions.
State Lock Conflicts
State Lock Conflicts
State lock issues
Terragrunt and Terraform use DynamoDB locks to prevent multiple people from applying changes at the same time on the same unit. If you see a state lock error, it usually means someone else is already running a deployment.What to do:- ⏳ Wait for the other deployment to finish.
- ✅ Verify you’re not overwriting someone else’s changes.
- ✅ Refresh your parameter. Save your current changes locally (they may be overwritten).
- 🚀 Apply your changes once you’re sure everything is okay.
Module Not Found
Module Not Found
Symptoms: Terraform module cannot be downloaded or located.Solutions:
- Run
terragrunt initagain to refresh modules. - Check internet connectivity for module downloads.
- Verify module source paths in configuration files.