Skip to content

pingbui/terragrunt-aws-example

Repository files navigation

aws-terraform

Terragrunt and terraform template for aws projects

Requirements:

  1. Terraform: version ~> v1.2.0
  2. Terragrunt: version ~> v0.37.1
  3. Aws-vault: version ~> v6.3.1
  4. Edit $HOME/.terraformrc:
plugin_cache_dir = "$HOME/.terraform.d/plugins"

Alias:

alias tg='terragrunt'
alias tgh='tg hclfmt'
alias tga='tgh && tg apply'
alias tgp='tgh && tg plan'

Steps to provision:

  • aws-vault to get AWS Vars:
aws-vault exec ${project_name}
  • Change account id in file account.hcl
  • Change config in file terragrunt parent if you EC2 role instead of access key
  • Update project spec in global.hcl
  • Set environment from ENV before provisoning env's resources (Default is 'dev'):
## Test env:
export ENV=test

## Staging env:
export ENV=stage

## Production env:
export ENV=prod
  • Then run:
(cd env/us-east-1/<resource-dir> && tg apply)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •