Skip to content

Instantly share code, notes, and snippets.

@atheiman
Last active October 24, 2023 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atheiman/d14fd55f6d06a2174c7aeb1d0e4a28e4 to your computer and use it in GitHub Desktop.
Save atheiman/d14fd55f6d06a2174c7aeb1d0e4a28e4 to your computer and use it in GitHub Desktop.
AWS organization terraform multi-account pipeline
  1. build accounts - this can be terraform executed in the mgmt acct
  2. multi-account terragrunt run-all
    template/
      terragrunt.hcl
      main.tf
    111111111111/
      customization.tf
    
    mkdir generated
    
    # acct id list can be loaded from anywhere
    for acctid in 111111111111 222222222222; do
      # copy in the base terraform template
      cp -r template generated/$acctid
      # copy in customizations
      cp -r $acctid generated/$acctid
    done
    
    # execute terraform in parallel across all accounts
    cd generated
    terragrunt run-all apply
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment