Config Profiles Example
This example demonstrates Atmos config profiles - a powerful feature for managing environment-specific configurations without duplicating settings across your infrastructure.
What are Config Profiles?
Config profiles allow you to:
- Switch between different configurations based on context (development, CI/CD, production)
- Override settings without modifying base configuration
- Share common configurations across team members
- Maintain clean separation between personal and team settings
Directory Structure
examples/config-profiles/
├── README.md
├── atmos.yaml # Base configuration (shared settings)
└── profiles/ # Profile definitions
├── developer/ # Developer workstation profile
│ ├── settings.yaml # Terminal and UI settings
│ └── auth.yaml # Local AWS SSO configuration
├── ci/ # CI/CD pipeline profile
│ ├── settings.yaml # CI-friendly settings (no color, etc.)
│ └── auth.yaml # GitHub OIDC authentication
└── production/ # Production deployment profile
├── settings.yaml # Production-safe settings
└── auth.yaml # Production AWS credentials
Usage
Single Profile
Activate a profile using the --profile flag:
# Use developer profile for local developmentatmos terraform plan vpc -s dev --profile developer# Use CI profile in GitHub Actionsatmos terraform apply vpc -s prod --profile ci
Multiple Profiles (Layered Configuration)
You can layer multiple profiles - rightmost wins:
# Base settings + developer overridesatmos terraform plan vpc -s dev --profile base --profile developer# Shared team settings + personal overridesatmos terraform plan vpc -s dev --profile team --profile personal
Environment Variable
Set a profile globally for your session:
export ATMOS_PROFILE=developeratmos terraform plan vpc -s dev # Automatically uses developer profile
Comma-Separated Profiles
atmos terraform plan vpc -s dev --profile base,developer,personal
Profile Precedence
Profiles are discovered and loaded from multiple locations (highest to lowest precedence):
- Configurable (
profiles.base_pathin atmos.yaml) - Project-hidden (
.atmos/profiles/in project) - XDG user (
~/.config/atmos/profiles/or$XDG_CONFIG_HOME/atmos/profiles/) - Project (
profiles/in project)
Configuration merge order:
- Base
atmos.yaml .atmos.d/directory configs- Profiles (left-to-right:
--profile base --profile developerapplies base first, then developer) - CLI flags and environment variables
Example Scenarios
Scenario 1: Developer Workstation
# Create personal developer profile in XDG locationmkdir -p ~/.config/atmos/profiles/developer# Configure AWS SSO for local developmentcat > ~/.config/atmos/profiles/developer/auth.yaml <<EOFauth:providers:aws-sso-dev:kind: aws/ssoregion: us-east-2start_url: https://my-company.awsapps.com/startidentities:dev-access:via:provider: aws-sso-devprincipal:account_id: "999888777666"permission_set: DeveloperAccessdefault: trueEOF# Use itatmos terraform plan vpc -s dev --profile developer
Scenario 2: CI/CD Pipeline
# .github/workflows/deploy.ymlname: Deploy Infrastructureon: [push]jobs:deploy:runs-on: ubuntu-latestpermissions:id-token: write # Required for OIDCcontents: readsteps:- uses: actions/checkout@v6- name: Deploy with CI profileenv:ATMOS_PROFILE: cirun: |atmos terraform apply vpc -s prod --auto-approve
Scenario 3: Production Deployment
# Production profile with strict settingsATMOS_PROFILE=production atmos terraform apply --dry-run vpc -s prod
Scenario 4: Team + Personal Configuration
# profiles/team/settings.yaml - shared by all developers# profiles/personal/settings.yaml - your personal overrides# Apply team settings, then your personal overridesatmos terraform plan vpc -s dev --profile team --profile personal
Profile Configuration Reference
settings.yaml
Configure terminal, logging, and behavior settings:
# profiles/developer/settings.yamlsettings:terminal:color: truemax_width: 120syntax_highlighting:enabled: truelogs:level: Debug
auth.yaml
Configure authentication providers and identities:
# profiles/ci/auth.yamlauth:providers:github-oidc:kind: github/oidcregion: us-east-1identities:ci-deployer:kind: aws/assume-rolevia:provider: github-oidcprincipal:assume_role: "arn:aws:iam::123456789012:role/GitHubActionsDeployRole"role_session_name: '{{ env "GITHUB_RUN_ID" }}'
Custom Configuration
Profiles can override any configuration in atmos.yaml:
# profiles/custom/overrides.yamlcomponents:terraform:base_path: ./custom-componentsstacks:base_path: ./custom-stacksintegrations:github:gitops:artifact_storage:region: eu-west-1 # Override default region
Managing Profiles
List Available Profiles
# Show all available profilesatmos profile list# Show details of a specific profileatmos profile show developer
Create New Profile
# Create in project (committed to git - shared with team)mkdir -p profiles/teamecho "settings:" > profiles/team/settings.yaml# Create in user directory (personal - not committed)mkdir -p ~/.config/atmos/profiles/personalecho "settings:" > ~/.config/atmos/profiles/personal/settings.yaml
Hide Profiles from Git
Use .atmos/profiles/ for project-specific profiles that shouldn't be committed:
mkdir -p .atmos/profiles/local-dev# Add to .gitignoreecho ".atmos/" >> .gitignore
Best Practices
- Project profiles (
profiles/) - Team-shared configurations (commit to git) - Hidden profiles (
.atmos/profiles/) - Project-specific, temporary configs (add to .gitignore) - User profiles (
~/.config/atmos/profiles/) - Personal preferences (never committed) - CI profiles - Non-interactive, deterministic configurations for pipelines
- Layer profiles - Use
--profile base --profile specificfor composition
Troubleshooting
Profile Not Found
$ atmos terraform plan vpc -s dev --profile nonexistentError: profile not found: 'nonexistent' (searched: [...])Available profiles: developer, ci, productionRun 'atmos profile list' to see all available profiles
Solution: Check profile name spelling or create the profile.
Multiple Profiles with Same Name
If a profile exists in multiple locations, the highest precedence location wins:
1. Configurable (profiles.base_path)
2. Project-hidden (.atmos/profiles/)
3. XDG user (~/.config/atmos/profiles/)
4. Project (profiles/)
Configuration Not Applying
Profiles are merged in order. Later profiles override earlier ones:
# base sets color: false, developer sets color: trueatmos --profile base --profile developer ... # color: true (developer wins)
See Also
- Atmos Profiles PRD - Complete design documentation
- CLI Configuration - Base configuration reference
- Authentication - Auth configuration guide