Skip to main content

Component Cheatsheet

Configuration

Folder Structure

├── atmos.yaml
├── components
│   └── myapp
│   ├── main.tf
│   ├── outputs.tf
│   └── variables.tf
└── stacks
├── catalog
│   └── myapp.yaml
└── deploy
├── dev.yaml
├── prod.yaml
└── staging.yaml

Stack Schema

import:
- catalog/something
vars:
key: value
components:
terraform:
$component:
vars:
foo: "bar"

Stack Overrides

terraform:
overrides:
env: {}
settings: {}
vars: {}
command: "opentofu"

Spacelift Settings

terraform:
components:
$component:
settings:
spacelift:
# The `autodeploy` setting was overridden with the value
# from `terraform.overrides.settings.spacelift.autodeploy`
autodeploy: true
workspace_enabled: true

Commands

List Components

atmos list components

Validate Components

atmos validate component $component -s $stack
atmos validate component $component -s $stack --schema-type jsonschema --schema-path $component.json
atmos validate component $component -s $stack --schema-type opa --schema-path $component.rego
atmos validate component $component -s $stack --schema-type opa --schema-path $component.rego --module-paths catalog
atmos validate component $component -s $stack --timeout 15

Terraform

Plan Root Modules

atmos terraform plan $component --stack $stack
atmos terraform plan $component --stack $stack -out $planfile

Apply Root Modules

atmos terraform apply $component --stack $stack
atmos terraform apply $component --stack $stack -auto-approve
atmos terraform apply $component --stack $stack $planfile

Deploy Root Modules

atmos terraform deploy
atmos terraform deploy $component --stack $stack -out $planfile
atmos terraform deploy $component --stack $stack -var "key=value"