Identity Flag Support for Describe Commands
The atmos describe family of commands now supports the --identity flag, enabling runtime authentication when processing YAML template functions that access remote resources. This ensures that !terraform.state and !terraform.output functions work seamlessly without relying on ambient credentials.
What Changed
All atmos describe subcommands now accept the --identity flag for runtime authentication:
atmos describe stacks --identity <name>atmos describe component <component> -s <stack> --identity <name>atmos describe affected --identity <name>atmos describe dependents <component> -s <stack> --identity <name>
This brings feature parity with atmos terraform and atmos workflow commands, which already support identity-based authentication.
The Problem We Solved
By default, all atmos describe commands execute YAML template functions (!terraform.state, !terraform.output) and Go templates during stack processing. When these functions access remote Terraform state backends (S3, Azure Blob, GCS), they require authenticated cloud provider credentials.
Before this change, users had to:
- Manually run
atmos auth login --identity <identity>before describe commands - Rely on ambient AWS credentials (environment variables,
~/.aws/credentials) - Use EC2 instance profiles (not applicable for local development)
The failure scenario looked like this:
# Stack configuration contains YAML function
# components:
# terraform:
# app:
# vars:
# vpc_id: !terraform.output vpc.vpc_id
# Command fails with timeout
$ atmos describe component app -s prod
Error: context deadline exceeded (accessing S3 without credentials)
How It Works
The --identity flag is now available on all describe commands via the parent atmos describe command. When specified, Atmos:
- Authenticates using the specified identity before processing stacks
- Populates AuthContext with cloud provider credentials
- Propagates credentials to YAML function processors
- Executes template functions with proper authentication
The flag supports two modes:
Explicit identity:
atmos describe stacks --identity my-aws-identity
Interactive selection:
atmos describe stacks --identity
# Shows interactive selector to choose from configured identities
Examples
Basic Usage
# Describe stacks with specific identity
atmos describe stacks --identity my-aws-identity
# Describe component with identity (shorthand)
atmos describe component vpc -s prod -i dev-admin
# Describe affected components with authentication
atmos describe affected --ref main --identity prod-readonly
# Describe dependents with identity
atmos describe dependents vpc -s prod --identity my-aws-identity
Interactive Selection
# Use --identity without a value for interactive selection
$ atmos describe stacks --identity
# Atmos shows selector:
> dev-admin
prod-readonly
staging-deploy
Combining with Other Flags
# Authenticate and filter results
atmos describe stacks --identity my-aws-identity --stack prod-use1 --format yaml
# Authenticate and query specific values
atmos describe component vpc -s prod -i dev-admin --query .vars.cidr_block
# Authenticate when describing affected components
atmos describe affected --identity prod-readonly --include-dependents --format json
Disabling YAML Functions
If you want to see stack configurations before YAML functions are processed (without authentication), use the processing flags:
# Disable YAML function processing
atmos describe stacks --process-functions=false
# Disable Go template processing
atmos describe stacks --process-templates=false
# Disable both
atmos describe stacks --process-functions=false --process-templates=false
Use Cases
1. Multi-Account Development
When working across multiple AWS accounts, authenticate with the appropriate identity:
# Development environment
atmos describe component app -s dev-use1 --identity dev-admin
# Production environment (read-only)
atmos describe component app -s prod-use1 --identity prod-readonly
2. CI/CD Pipelines
Authenticate in CI/CD before describing affected components:
# In GitHub Actions, GitLab CI, etc.
atmos describe affected \
--identity "$ATMOS_IDENTITY" \
--ref "$BASE_BRANCH" \
--format json > affected.json
