developing-components
БесплатноБез исполняемых скриптовНе проверенUse when creating new Terraform/OpenTofu components or modifying existing ones. Covers required files, catalog defaults, stack configuration, and naming…
от cloudposse★ 100 звёзд на GitHubОб этом скилле
Developing Components
Scope: This skill is generic and applies to any Cloud Posse reference architecture project. It covers patterns for vendoring 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
ls components/terraform/
Many use cases can be solved by configuring existing generic components via catalog:
iam-role- Any IAM role. Createstacks/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:
gh release view --repo cloudposse-terraform-components/aws-<component> --json tagName
Vendoring a Cloud Posse Component
- Create the component directory and
component.yaml:
mkdir -p components/terraform/<component-name>
- Create
components/terraform/<component-name>/component.yaml:
apiVersion: atmos/v1
kind: ComponentVendorConfig
spec:
source:
uri: github.com/cloudposse-terraform-components/aws-<component>.git//src?ref={{ .Version }}
version: <latest-version> # Use gh release view to find this
included_paths:
- "**/**"
excluded_paths:
- "providers.tf"
mixins:
# Use provider mixin without account-map dependency (for single-account deployments)
- uri: https://raw.githubusercontent.com/cloudposse-terraform-components/mixins/{{ .Version }}/src/mixins/provider-without-account-map.tf
version: v0.3.2
filename: providers.tf
- Pull the component:
atmos vendor pull -c <component-name>
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 theaccount_map_enabledvariable and dummyiam_rolesmodule for compatibility.versions.tf- OpenTofu/Terraform and provider version constraintsvariables.tf- Component-specific input variablesmain.tf- Main resource definitionsoutputs.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 compo
Установить developing-components в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл developing-components?
Use when creating new Terraform/OpenTofu components or modifying existing ones. Covers required files, catalog defaults, stack configuration, and naming conventions.
Как установить скилл developing-components?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл developing-components запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic