Skip to main content
atmos.yaml2.4 KB
View on GitHub
# atmos:template
# Atmos configuration for [[ .Config.project_name ]] (AWS landing zone).
# https://atmos.tools/cli/configuration

base_path: "./"

components:
terraform:
command: [[ .Config.terraform_command ]]
base_path: "components/terraform"
apply_auto_approve: false
deploy_run_init: true
init_run_reconfigure: true
# Generate backend.tf.json from the `terraform.backend` block in
# stacks/_defaults.yaml. Atmos natively provisions the S3 state bucket
# before `terraform init` (`terraform.provision.backend.enabled`).
auto_generate_backend_file: true

stacks:
base_path: "stacks"
included_paths:
- "**/*"
excluded_paths:
- "**/_defaults.yaml"
name_template: "{{ .vars.stage }}"

# A single aws/emulator identity binds every component to the local emulator.
# `atmos emulator up aws -s <stage>` starts it; this identity and the
# provider-config contributor wire Terraform to it — no providers.tf, no
# endpoint configuration, no docker-compose.
auth:
identities:
local:
kind: aws/emulator
emulator: aws
default: true
# Real AWS instead of the local emulator: uncomment, fill in credentials
# (or swap for aws/permission-set with an SSO provider), and run with
# `--identity aws` -- or move `default: true` here once configured. Never
# commit real access keys; use !env or a shared credentials profile.
# https://atmos.tools/cli/commands/auth
# aws:
# kind: aws/user
# credentials:
# access_key_id: !env AWS_ACCESS_KEY_ID
# secret_access_key: !env AWS_SECRET_ACCESS_KEY
# region: "[[ .Config.region ]]"

logs:
file: "/dev/stderr"
level: Info

commands:
- name: test
description: Validate stacks, then provision and destroy every environment on the local emulator.
steps:
- atmos validate stacks
# dev
- atmos emulator up aws -s dev
- atmos terraform apply --all -s dev -auto-approve
- atmos terraform destroy --all -s dev -auto-approve
- atmos emulator down aws -s dev
# staging
- atmos emulator up aws -s staging
- atmos terraform apply --all -s staging -auto-approve
- atmos terraform destroy --all -s staging -auto-approve
- atmos emulator down aws -s staging
# prod
- atmos emulator up aws -s prod
- atmos terraform apply --all -s prod -auto-approve
- atmos terraform destroy --all -s prod -auto-approve
- atmos emulator down aws -s prod

Related Documentation