Nayeem Mohammed
10/07/2025, 7:14 PMvpc:
# Backend configuration for environment-based key structure
backend:
s3:
workspace_key_prefix: "dev/terraform/vpc"
vars:
# CloudPosse label configuration
enabled: true
environment: "dev" # ← Environment
name: "vpc" # ← Component name
vpc:
name: "vpc-dev" # ← User-defined VPC name (used directly)
cidr_block: "172.22.0.0/21"
availability_zones:
- "us-west-2a"
- "us-west-2b"
- "us-west-2c"
# Subnet Configuration
subnets:
private:
- "172.22.0.0/24"
- "172.22.1.0/24"
- "172.22.2.0/24"
public:
- "172.22.3.0/24"
- "172.22.4.0/24"
- "172.22.5.0/24"
eks:
eks-cluster:
# Backend configuration for environment-based key structure
backend:
s3:
workspace_key_prefix: "dev/terraform/eks-cluster"
metadata:
component: "eks-cluster"
settings:
depends_on:
vpc:
component: "vpc"
vars:
# CloudPosse Context Configuration
eks_cluster_name: "eks-cluster-dev"
# Development environment specific overrides
cluster_version: "1.33"
#VPC Configuration
vpc_name: "vpc-dev"
vpc_id: "vpc-3jd78hh83"
vpc_name here in eks cluster i have hard-coded it
can i use something like
{component.vpc.vpc_id}Andriy Knysh (Cloud Posse)
10/07/2025, 7:46 PM!terraform.state YAML function since it's the fastest
https://atmos.tools/functions/yaml/terraform.stateNayeem Mohammed
10/07/2025, 7:56 PMAndriy Knysh (Cloud Posse)
10/07/2025, 8:05 PM!terraform.state and !terraform.output should work "across" backends (https://atmos.tools/core-concepts/components/terraform/backends/).
!terraform.state reads the backend config from the component (check the backend config with atmos describe component), and will use the configured s3 bucket to read the state from, including assuming the backend IAM role (if configured in the backend).
!terraform.output generates the backend file (from the Atmos component backend config) and executes terraform output command. Terraform itself reads the backend file, and if it has all the permissions, will get the output and return it to Atmos
Please test it and let us know if you see any issuesNayeem Mohammed
10/08/2025, 9:39 PMAndriy Knysh (Cloud Posse)
10/08/2025, 9:42 PMatmos describe component will evaluate the YAML functions and show the final values in the output