cloudposse/docs/developing-components
- community
Checking that the SKILL.md file is still in the repository.
Use when creating new Terraform/OpenTofu components or modifying existing ones. Covers required files, catalog defaults, stack configuration, and naming conventions.
Install
npx vskill@latest install cloudposse/docs/developing-componentsSKILL.md
Developing Components
Scope: This skill is generic and applies to any Cloud Posse reference architecture project. It covers patterns forvendoring and creating Terraform components that are consistent across all customers.
Components are opinionated Terraform root modules that implement a specific AWS resource with predefined conventions.
Before Creating a New Component
Always check for existing components first. Creating new components adds maintenance burden.
1. Check Local Components
Many use cases can be solved by configuring existing generic components via catalog:
- `iam-role` - Any IAM role. Create
stacks/catalog/iam-role/my-role.yamlinstead of a new component. - `s3-bucket` - Any S3 bucket with standard configurations.
- `lambda` - Lambda functions with common patterns.
2. Check Cloud Posse Component Library
Browse https://docs.cloudposse.com/components/library/ for pre-built components. Common ones:
eks/cluster- Kubernetesaurora-postgres,rds- Databaseselasticache-redis- Cachingecs,ecs-service- Container workloadss3-bucket,dynamodb,sqs-queue- Storage and messagingcloudwatch-logs,sns-topic- Monitoring and notifications
Cloud Posse Component Sources
| Resource | Location | |
|---|---|---|
| Component Library Docs | https://docs.cloudposse.com/components/library/ | |
| Component Repositories | github.com/cloudposse-terraform-components/aws-<service> | |
| Mixins Repository | github.com/cloudposse-terraform-components/mixins |
Find latest version:
Vendoring a Cloud Posse Component
- Create the component directory and
component.yaml:
- Create
components/terraform/<component-name>/component.yaml:
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
- Pull the component:
3. When to Create a Custom Component
Create a new component when:
- Tightly coupled resources - The resources share the same lifecycle and must be created/destroyed together. For
example, an application-specific ECS service with its ALB target group, CloudWatch alarms, and autoscaling policies.
- Unique to your infrastructure - The configuration is specific to your organization and wouldn't benefit from Cloud
Posse's generic abstractions.
- Single account/region deployment - All resources deploy to one AWS account and region. If resources span accounts
or regions, split into separate components.
Teralithic components (all-in-one) are appropriate when:
- Resources are always deployed together and never independently
- Splitting would create artificial boundaries requiring complex cross-component wiring
- The blast radius is acceptable (all resources affected by any change)
Avoid custom components when:
- You're wrapping a single AWS resource (use generic components instead)
- The resources have different lifecycles (e.g., database vs. application)
- You might reuse this pattern elsewhere (vendor or create a generic component)
New Component Structure
Every new component requires three parts:
1. Root Module (components/terraform/<component-name>/)
Required files (copy from an existing component like ecs):
- `context.tf` - Always identical across all components. Copy from any existing component. Provides Cloud Posse's
null-label context for consistent naming.
- `providers.tf` - Standard provider configuration. Copy from an existing component. Includes the
account_map_enabled variable and dummy iam_roles module for compatibility.
- `versions.tf` - OpenTofu/Terraform and provider version constraints
- `variables.tf` - Component-specific input variables
- `main.tf` - Main resource definitions
- `outputs.tf` - Output values
Note on remote-state.tf: Avoid creating remote-state.tf files for new components. Instead, use Atmos functions (!terraform.state) in stack YAML to pass values from other components. This keeps components simpler and moves cross-component wiring to the stack configuration layer.
2. Catalog Defaults (stacks/catalog/<component-name>/defaults.yaml)
Define organization-wide default values for the component, including dependency lookups:
3. Stack Configuration (stacks/orgs/acme/<tenant>/<stage>/<region>/<layer>.yaml)
Import the catalog - often no component block is needed if catalog defaults are complete:
If overrides are needed:
Naming Conventions
- Use descriptive, specific names that indicate the component's purpose
- Prefix with the service/platform when specific (e.g.,
ecs-adot-collectornot justadot-collector) - Use slashes for component hierarchies in catalogs (e.g.,
iam-role/grafana-cloudwatch-access,
grafana/datasource/cloudwatch)
Stack File Organization
Stack files in stacks/orgs/acme/ mirror the AWS account structure:
orgs/acme/core/- Core accounts (root, audit, security, network, auto, artifacts)orgs/acme/plat/- Platform accounts (sandbox, dev, staging, prod)
Within each stage, organized by region:
global-region/- Global (us-east-1) resources like IAMus-east-2/- Regional resources
Regional stack files are typically split by layer:
foundation.yaml- VPC, networking, base infrastructureplatform.yaml- Shared platform services (ECS clusters, databases)app.yaml- Application-specific resources
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingexamples/snippets/.claude/skills/developing-components/SKILL.md
Popularity
- Repository stars
- 96
- Repository forks
- 34
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 10 May 2026, 5 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/developing-components)