cloudposse/docs/atmos-functions
- community
Checking that the SKILL.md file is still in the repository.
Use when wiring cross-component dependencies in stack YAML. Covers !terraform.state syntax for passing outputs between components without remote-state lookups.
Install
npx vskill@latest install cloudposse/docs/atmos-functionsSKILL.md
Cross-Component Dependencies with Atmos Functions
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 Syntax
Two-parameter form (current stack):
Three-parameter form (specific stack):
Examples
!terraform.output Alternative
There's also !terraform.output which has the same syntax but different behavior:
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.
Best Practices
- Use `!terraform.state` over `!terraform.output` - Direct S3 access is much faster than running Terraform.
- Define lookups in catalog defaults - Put
!terraform.stateexpressions in
stacks/catalog/<component>/defaults.yaml rather than in stack files. The function automatically resolves based on the current stack context.
- Use current-stack lookups when possible - Omit the stack parameter to look up components in the same stack, making
configs more portable.
- Cross-stack lookups for shared resources - Use the three-parameter form when referencing centralized resources
(e.g., Grafana in core-auto from plat accounts).
Legacy Approach (Being Phased Out)
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.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationPassed, 83 of 100Effective. 1 run. Evaluated 7 months ago.
Source
- SKILL.md in the repositoryCheckingexamples/snippets/.claude/skills/atmos-functions/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 16 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cloudposse/docs/atmos-functions)