atmos.yaml13.7 KB
View on GitHub# CLI config is loaded from the following locations (from lowest to highest priority):
# system dir ('/usr/local/etc/atmos' on Linux, '%LOCALAPPDATA%/atmos' on Windows)
# home dir (~/.atmos)
# current directory
# ENV vars
# Command-line arguments
#
# It supports POSIX-style Globs for file names/paths (double-star '**' is supported)
# https://en.wikipedia.org/wiki/Glob_(programming)
# Base path for components, stacks and workflows configurations.
# Can also be set using 'ATMOS_BASE_PATH' ENV var, or '--base-path' command-line argument.
# Supports both absolute and relative paths.
# If not provided or is an empty string, 'components.terraform.base_path', 'components.helmfile.base_path', 'stacks.base_path' and 'workflows.base_path'
# are independent settings (supporting both absolute and relative paths).
# If 'base_path' is provided, 'components.terraform.base_path', 'components.helmfile.base_path', 'stacks.base_path' and 'workflows.base_path'
# are considered paths relative to 'base_path'.
base_path: "."
# Toolchain management configures HOW required tools are installed; WHICH tools and
# versions are declared in the stacks via `dependencies.tools` (e.g. OpenTofu in
# stacks/orgs/acme/_defaults.yaml). Tools are resolved from the Aqua registry and
# locked in `toolchain.lock.yaml` (commit it) for reproducible installs.
# https://atmos.tools/cli/commands/toolchain
toolchain:
# Where installed tool binaries live (relative to the base path).
install_path: .tools
# Resolve installs against the committed lockfile for reproducibility.
use_lock_file: true
registries:
# The official Aqua registry provides metadata for standard tools (opentofu, …).
- name: aqua
type: aqua
priority: 100
components:
terraform:
# Optional `command` specifies the executable to be called by `atmos` when running Terraform commands
# If not defined, `terraform` is used
# Examples:
# command: terraform
# command: /usr/local/bin/terraform
# command: /usr/local/bin/terraform-1.8
# command: tofu
# command: /usr/local/bin/tofu-1.7.1
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_COMMAND' ENV var, or '--terraform-command' command-line argument
# This example uses OpenTofu (pinned via the toolchain below and `dependencies.tools`).
command: tofu
# Keep provider lockfiles complete for local development and CI platforms.
# The post-init providers-lock hook uses this list when a provider cache or
# mirror causes OpenTofu to record only host-platform checksums.
platforms:
- darwin_arm64
- linux_amd64
# Cache provider and module registry downloads behind Atmos's local registry
# proxy. The first init warms the cache; repeated plans avoid re-downloading
# the same artifacts.
cache:
enabled: true
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_BASE_PATH' ENV var, or '--terraform-dir' command-line argument
# Supports both absolute and relative paths
base_path: "components/terraform"
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE' ENV var
apply_auto_approve: false
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT' ENV var, or '--deploy-run-init' command-line argument
deploy_run_init: true
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE' ENV var, or '--init-run-reconfigure' command-line argument
init_run_reconfigure: true
# Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE' ENV var, or '--auto-generate-backend-file' command-line argument
# Generate `backend.tf.json` per component so OpenTofu uses the S3 backend
# (provisioned in the emulator via `provision.backend.enabled`).
auto_generate_backend_file: true
stacks:
# Can also be set using 'ATMOS_STACKS_BASE_PATH' ENV var, or '--config-dir' and '--stacks-dir' command-line arguments
# Supports both absolute and relative paths
base_path: "stacks"
# Can also be set using 'ATMOS_STACKS_INCLUDED_PATHS' ENV var (comma-separated values string)
included_paths:
- "orgs/**/*"
# Can also be set using 'ATMOS_STACKS_EXCLUDED_PATHS' ENV var (comma-separated values string)
excluded_paths:
- "**/_defaults.yaml"
# Can also be set using 'ATMOS_STACKS_NAME_TEMPLATE' ENV var
name_template: "{{ if eq .vars.stage \"local\" }}local{{ else }}{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}{{ end }}"
workflows:
# Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line argument
# Supports both absolute and relative paths
base_path: "stacks/workflows"
# Authentication identities.
# The `local-aws` identity targets the `local/aws` emulator instance. Identities
# are project-scoped, so every platform stack can use this one local sandbox.
auth:
identities:
local-aws:
kind: aws/emulator
emulator: local/aws
default: true
# Stores for sharing data between components and for storing secrets.
# All stores authenticate to the local AWS emulator via the `local-aws` identity.
stores:
config/ssm:
kind: aws/ssm
identity: local-aws
options:
region: us-east-1
prefix: /atmos/quickstart/config
secrets/ssm:
kind: aws/ssm
identity: local-aws
secret: true
options:
region: us-east-1
prefix: /atmos/quickstart/secrets
secrets/asm:
kind: aws/asm
identity: local-aws
secret: true
options:
region: us-east-1
prefix: /atmos/quickstart/secrets
logs:
# Supported log levels: Trace, Debug, Info, Warning, Off
# Can also be set using 'ATMOS_LOGS_LEVEL' ENV var, or '--logs-level' command-line argument
level: Info
# Custom CLI commands
commands:
- name: test
description: Run the advanced quick-start stack end to end
flags:
- name: stack
shorthand: s
description: Target stack (for example, plat-ue2-dev)
required: true
steps:
- name: sandbox
type: stage
title: Start sandbox
- type: shell
command: atmos emulator up aws -s local
- name: validate
type: stage
title: Validate stack manifests
- type: shell
command: atmos validate stacks
- name: secrets
type: stage
title: Seed required secrets
- type: shell
command: atmos secret set API_KEY=sk-quickstart-example -s {{ .Flags.stack }} -c app-config --force
- type: shell
command: atmos secret set 'DB_CONFIG={"username":"app","password":"s3cr3t"}' -s {{ .Flags.stack }} -c app-config --force
- name: plan
type: stage
title: Plan component graph
- type: shell
command: atmos terraform plan --all -s {{ .Flags.stack }} || [ "$?" -eq 2 ]
- name: deploy
type: stage
title: Deploy component graph
- type: shell
command: atmos terraform deploy --all -s {{ .Flags.stack }}
- name: inspect
type: stage
title: Inspect deployed configuration
- type: shell
command: atmos terraform output app-config -s {{ .Flags.stack }}
- type: shell
command: atmos describe component app-config -s {{ .Flags.stack }} --provenance
- name: destroy
type: stage
title: Destroy component graph
- type: shell
command: atmos terraform destroy --all -s {{ .Flags.stack }} -auto-approve
- name: stop
type: stage
title: Stop sandbox
- type: shell
command: atmos emulator down aws -s local
- type: toast
level: success
content: "Advanced quick-start test complete."
- name: operator
description: Operator shortcuts for exploring and running the quick-start stack
commands:
- name: status
description: Show the stack/component tree and next operator checks
flags:
- name: stack
shorthand: s
description: Target stack (for example, plat-ue2-dev)
required: true
steps:
- name: stacks
type: stage
title: Stack import tree
- type: shell
command: atmos list stacks --format tree --provenance
- name: instances
type: stage
title: Component instances in {{ .Flags.stack }}
- type: shell
command: atmos list instances --stack {{ .Flags.stack }} --format tree --provenance
- name: catalog
type: stage
title: Component catalog
- type: spin
title: Resolving component catalog
command: atmos list components
- type: table
title: Next operator commands
columns:
- task
- command
data:
- task: Validate manifests
command: atmos validate stacks
- task: Deploy stack
command: atmos terraform deploy --all -s {{ .Flags.stack }}
- task: Destroy stack
command: atmos terraform destroy --all -s {{ .Flags.stack }} -auto-approve
- type: toast
level: success
content: "Operator status complete for {{ .Flags.stack }}."
- name: inspect
description: Inspect a component and show where its values came from
arguments:
- name: component
description: Component to inspect
flags:
- name: stack
shorthand: s
description: Target stack (for example, plat-ue2-dev)
required: true
steps:
- name: provenance
type: stage
title: Component configuration provenance
- type: shell
command: atmos describe component {{ .Arguments.component }} -s {{ .Flags.stack }} --provenance
- type: toast
level: info
content: "Use `atmos terraform plan {{ .Arguments.component }} -s {{ .Flags.stack }}` to preview changes, or omit the component/stack in an interactive terminal and Atmos will prompt you."
# Validation schemas (for validating atmos stacks and components)
schemas:
# https://json-schema.org
jsonschema:
# Can also be set using 'ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATH' ENV var, or '--schemas-jsonschema-dir' command-line argument
# Supports both absolute and relative paths
base_path: "stacks/schemas/jsonschema"
# https://www.openpolicyagent.org
opa:
# Can also be set using 'ATMOS_SCHEMAS_OPA_BASE_PATH' ENV var, or '--schemas-opa-dir' command-line argument
# Supports both absolute and relative paths
base_path: "stacks/schemas/opa"
# JSON Schema to validate Atmos manifests
# https://atmos.tools/cli/schemas/
# https://atmos.tools/cli/commands/validate/stacks/
# https://atmos.tools/quick-start/advanced/configure-validation/
# https://json-schema.org/draft/2020-12/release-notes
# https://www.schemastore.org/json
# https://github.com/SchemaStore/schemastore
# atmos:
# Can also be set using 'ATMOS_SCHEMAS_ATMOS_MANIFEST' ENV var, or '--schemas-atmos-manifest' command-line argument
# Supports both absolute and relative paths (relative to the `base_path` setting in `atmos.yaml`)
# Supports URLs like https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
# manifest: "stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
# manifest: "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
# `Go` templates in Atmos manifests
# https://atmos.tools/core-concepts/stacks/templates
# https://pkg.go.dev/text/template
templates:
settings:
enabled: true
evaluations: 1
# https://masterminds.github.io/sprig
sprig:
enabled: true
# https://docs.gomplate.ca
gomplate:
enabled: true
# https://docs.gomplate.ca/datasources
datasources: {}
settings:
experimental: silence
# `list_merge_strategy` specifies how lists are merged in Atmos stack manifests.
# Can also be set using 'ATMOS_SETTINGS_LIST_MERGE_STRATEGY' environment variable, or '--settings-list-merge-strategy' command-line argument
# The following strategies are supported:
# `replace`: Most recent list imported wins (the default behavior).
# `append`: The sequence of lists is appended in the same order as imports.
# `merge`: The items in the destination list are deep-merged with the items in the source list.
# The items in the source list take precedence.
# The items are processed starting from the first up to the length of the source list (the remaining items are not processed).
# If the source and destination lists have the same length, all items in the destination lists are
# deep-merged with all items in the source list.
list_merge_strategy: replace
# List command configurations
# Configure output columns and format for different list commands
list:
# Configuration for "atmos list components" command
# Shows unique component definitions (deduplicated across stacks)
components:
format: table
columns:
- name: Component
value: "{{ .component }}"
- name: Type
value: "{{ .type }}"
- name: Stacks
value: "{{ .stack_count }}"
# Configuration for "atmos list instances" command
# Shows component instances (one entry per component+stack pair)
instances:
format: table
columns:
- name: " "
value: "{{ .status }}"
- name: Stack
value: "{{ .stack }}"
- name: Component
value: "{{ .component }}"
- name: Type
value: "{{ .type }}"
- name: Tenant
value: "{{ .vars.tenant }}"
- name: Environment
value: "{{ .vars.environment }}"
- name: Stage
value: "{{ .vars.stage }}"
- name: Region
value: "{{ .vars.region }}"
- name: Component Folder
value: "{{ .component_folder }}"