atmos.yaml3.0 KB
View on GitHubbase_path: "./"
# Toolchain: Atmos automatically downloads and installs OpenTofu (the `tofu`
# binary) before running the component, so this example needs no pre-installed
# Terraform/OpenTofu. The opentofu dependency is declared per component (see
# stacks/catalog/random-pet.yaml).
toolchain:
install_path: .tools
versions_file: .tool-versions
registries:
# Official Aqua public registry — resolves `opentofu` (and other tools).
- name: aqua-public
type: aqua
source: https://github.com/aquaproj/aqua-registry/tree/main/pkgs
priority: 10
components:
terraform:
# Use OpenTofu. Atmos invokes the `tofu` binary the toolchain installs.
command: tofu
base_path: "components/terraform"
apply_auto_approve: true
deploy_run_init: true
init_run_reconfigure: true
auto_generate_backend_file: false
# Disable Terraform's own provider plugin cache so the registry cache below is
# the single caching layer this example demonstrates. With the plugin cache on
# (the Atmos default), Terraform serves providers from TF_PLUGIN_CACHE_DIR and
# never contacts the proxy on a re-init, so the end-of-run savings report would
# show nothing. Turning it off routes every install through the proxy, making
# the "saved" vs "downloaded and cached" report observable.
plugin_cache: false
# Target platforms this project builds for. A single list drives BOTH eager
# multi-platform pre-seeding (atmos terraform cache mirror random-pet -s dev)
# AND the automatic post-init `providers lock` that keeps .terraform.lock.hcl
# complete across platforms, so a committed lock installs cleanly on every
# platform in a fleet. Empty defaults to the host platform.
platforms:
- linux_amd64
- darwin_arm64
- windows_amd64
# Enable the transparent Terraform registry cache. Providers and modules are
# cached behind an ephemeral local network-mirror proxy, so repeated and CI
# runs stop re-downloading the same artifacts, keep working through registry
# outages, and preserve the exact versions a deployment used. Modules are
# cached lazily through the proxy on `init` (registry metadata always, archive
# content when the registry serves an HTTP archive). The lazy proxy alone only
# caches the host platform; `atmos terraform cache mirror` pre-fetches every
# platform in `platforms` above into the same canonical filesystem_mirror layout.
cache:
enabled: true
stacks:
base_path: "stacks"
included_paths:
- "deploy/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_template: "{{.vars.stage}}"
logs:
level: Info
file: "/dev/stderr"
# `atmos test` runs this in CI. These steps need no terraform binary or network:
# they prove the cache.mirror configuration resolves and the cache is reachable.
commands:
- name: test
description: "Validate the caching example (no terraform/network required)"
steps:
- atmos describe component random-pet -s dev
- atmos terraform cache stats