en un clic
atmos-functions
// Use when wiring cross-component dependencies in stack YAML. Covers !terraform.state syntax for passing outputs between components without remote-state lookups.
// Use when wiring cross-component dependencies in stack YAML. Covers !terraform.state syntax for passing outputs between components without remote-state lookups.
Use when creating new Terraform/OpenTofu components or modifying existing ones. Covers required files, catalog defaults, stack configuration, and naming conventions.
Use when authenticating with AWS via Atmos. Covers ATMOS_PROFILE setup, SSO login, and how Atmos automatically assumes the correct identity per stack. Use for authentication setup, SSO login issues, and permission errors.
Use when deploying components via Atmos stacks, configuring stack YAML, or understanding inheritance patterns. Covers catalog defaults, abstract components, stack imports, and how to wire components into target stacks.
Building, rendering library docs, and deploying docs.cloudposse.com. Use when working with the Docusaurus build process or regenerating auto-generated content.
Writing standards, React components, and MDX patterns for docs.cloudposse.com. Use when creating or editing documentation content.
CSS styles, color themes, and visual conventions for docs.cloudposse.com. Use when styling components, mermaid diagrams, or working with site theming.
| name | atmos-functions |
| description | Use when wiring cross-component dependencies in stack YAML. Covers !terraform.state syntax for passing outputs between components without remote-state lookups. |
Preferred approach: Atmos Functions - Use Atmos template functions in stack YAML to pass values between components at plan/apply time. This avoids Terraform remote state lookups entirely.
!terraform.state SyntaxTwo-parameter form (current stack):
!terraform.state <component> <output>
Three-parameter form (specific stack):
!terraform.state <component> <stack> <output>
components:
terraform:
my-component:
vars:
# Current stack lookups (component output)
vpc_id: !terraform.state vpc vpc_id
subnet_ids: !terraform.state vpc private_subnet_ids
# Cross-stack lookup (component stack output)
grafana_role_arn: !terraform.state grafana core-use2-auto workspace_iam_role_arn
# Nested output with YQ expression
role_arn: !terraform.state iam-role/my-role plat-use2-dev .role.arn
!terraform.output AlternativeThere's also !terraform.output which has the same syntax but different behavior:
# Same syntax as !terraform.state
vpc_id: !terraform.output vpc vpc_id
Key differences:
| Aspect | !terraform.state (preferred) | !terraform.output |
|---|---|---|
| How it works | Reads directly from S3 state bucket | Runs terraform init + terraform output |
| Speed | Fast (direct S3 read) | Slow (full Terraform initialization) |
| Use case | Default choice | When state file format differs |
Always prefer !terraform.state - it's significantly faster because it reads the state file directly from S3
without running Terraform commands.
!terraform.state over !terraform.output - Direct S3 access is much faster than running Terraform.!terraform.state expressions in
stacks/catalog/<component>/defaults.yaml rather than in stack files. The function automatically resolves based on
the current stack context.Some older components still use Cloud Posse's remote-state Terraform module with remote-state.tf files. This pattern
is being phased out in favor of Atmos functions. The tfstate backend is in the core-auto account.
When you encounter remote-state.tf files, prefer converting them to !terraform.state expressions in the catalog.