Migrate from Account-Map
This guide walks through migrating from the account-map component to the new approach using Atmos stack variables, Atmos Auth, and Atmos Functions.
The migration from account-map is a significant architectural change that has not yet been fully documented. If you're interested in migrating an existing deployment, please reach out to Cloud Posse for support.
Overview
The account-map component is being deprecated in favor of a simpler approach that:
- Stores account configuration directly in Atmos stack variables
- Uses Atmos Auth for authentication before Terraform runs
- Uses Atmos Functions for dynamic value resolution
- Enables brownfield adoption where accounts already exist
For background on why account-map is being deprecated, see Legacy Account Map.
Why Migrate?
The legacy account-map component pattern required:
- Deploying account-map component first
- Remote state lookups for every component that needed account IDs
- Complex
providers.tfwith remote-state module calls - Cross-account state access permissions
The new pattern:
- Static account map defined once in stack defaults
- No remote state dependencies for account lookups
- Simpler provider configuration
- Works with Atmos Auth for authentication
Before You Begin
The migration involves several coordinated changes:
- Adding account IDs to Atmos stack variables
- Updating component providers to remove
account-mapdependency - Removing
aws-teamsandaws-team-rolescomponents (replaced by IAM Identity Center) - Configuring Atmos Auth profiles and IAM Identity Center Permission Sets
- Deploying
iam-rolecomponents for Terraform execution
This is a breaking change that affects how Terraform authenticates and resolves account information. Plan for a maintenance window and test thoroughly in non-production environments first.
Key Configuration
Stack Defaults
The account map is defined in your organization's defaults file:
# stacks/orgs/NAMESPACE/_defaults.yaml
vars:
account_map_enabled: false
account_map:
full_account_map:
acme-core-root: "111111111111"
acme-core-audit: "222222222222"
acme-core-auto: "333333333333"
acme-plat-dev: "444444444444"
acme-plat-staging: "555555555555"
acme-plat-prod: "666666666666"
# ... all accounts
iam_role_arn_templates:
terraform: "arn:aws:iam::%s:role/acme-core-gbl-auto-terraform"
audit_account_account_name: "acme-core-audit"
root_account_account_name: "acme-core-root"