Required
Mark identities as required: true so they are automatically authenticated before Terraform runs — without prompting or
selection.
The Problem
When Terraform components use multiple AWS provider aliases for multi-account patterns (e.g., hub-spoke networking or cross-account peering), each provider assumes a different IAM role. In CI environments with OIDC authentication, only the primary identity's profile is written to the shared credentials file. The additional provider aliases fail because their AWS profiles don't exist.
Configuration
Set required: true on any identity that should be automatically authenticated:
atmos.yaml
These snippets only show the default and required fields. Each aws/assume-role identity also requires
via and principal configuration. See Identities for complete examples.
The required and default fields are orthogonal:
default: true— this is the PRIMARY identity (setsAWS_PROFILE, credential env vars). Only one allowed.required: true— auto-authenticate this identity without prompting. Multiple allowed.
All required identities must be defined in your identities configuration
(either globally in atmos.yaml or via component-level overrides).
Behavior
requiredA boolean field on an identity that marks it for automatic authentication. Before Terraform runs, Atmos authenticates the default identity as the primary, then authenticates every identity with
required: trueand writes all profiles to the shared AWS credentials file.- The default identity is always the primary, setting
AWS_PROFILEand default credential environment variables. - Required non-default identities are authenticated as secondary — their profiles are written to the shared credentials file, making them available for Terraform provider aliases.
- The
--identityCLI flag takes precedence overdefaultfor primary selection, but required identities are still authenticated as secondary. - Failures for non-primary required identities are non-fatal — Atmos logs a warning and continues.
- The default identity is always the primary, setting
Example
A hub-spoke networking component that peers VPCs across three AWS accounts:
stacks/catalog/transit-gateway.yaml
Each identity's AWS profile is available for the corresponding Terraform provider alias:
components/terraform/transit-gateway/providers.tf
See Also
- Identities — Configure the identities used with
required: true - Providers — Configure authentication providers (SSO, OIDC, SAML)