소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 7월 3일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill terraform-module-design명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | terraform-module-design |
| description | >- Use when this capability is needed. |
You guide the structure and interface design of Terraform modules in the Catalyst infrastructure/modules/ tree. You enforce the leaf/composite split from AGENTS.md §6 and naming conventions from AGENTS.md.
Leaf modules wrap a single AWS resource type with hardened defaults:
infrastructure/modules/leaf/
kms-key/ # One CMK + alias + rotation + key policy
s3-secure-bucket/ # One bucket + BPA + SSE-KMS + versioning + TLS policy
dynamodb-table/ # One table + on-demand + PITR + KMS + tags
iam-role/ # One role + inline policy via data source
sg-base/ # One SG with named rules
cw-log-group/ # One log group + KMS + retention
sns-topic-encrypted/ # One topic + KMS + subscription policy
Composite modules compose multiple leaf modules and AWS resources into a functional unit:
infrastructure/modules/composite/
network/ # VPC + subnets + endpoints + NAT + flow logs
aurora-serverless-v2/ # Cluster + IAM auth + param group + secret
ecs-fargate-service/ # Cluster + task def + service + ALB + autoscaling + logs
lambda-python-fn/ # Function + role + log group + alias + alarms
...
Rule: a leaf module should have one primary resource and its directly coupled dependencies (e.g., a bucket + its policy + its ACL config). If you're composing 3+ leaf modules, that's a composite.
# variables.tf — inputs
variable "name" {
description = "Resource name (kebab-case, used in AWS identifiers)"
type = string
validation {
condition = can(regex("^[a-z0-9-]+$", var.name))
error_message = "Name must be kebab-case (lowercase alphanumeric and hyphens)."
}
}
variable "environment" {
description = "Deployment environment (dev, stage, prod)"
type = string
validation {
condition = contains(["dev", "stage", "prod"], var.environment)
error_message = "Environment must be dev, stage, or prod."
}
}
variable "kms_key_arn" {
description = "ARN of the KMS key for encryption at rest"
type = string
}
variable "tags" {
description = "Tags to apply to all resources"
type = map(string)
default = {}
}
# outputs.tf — contracts
output "arn" {
description = "ARN of the created resource"
value = aws_s3_bucket.this.arn
}
output "id" {
description = "ID of the created resource"
value = aws_s3_bucket.this.id
}
| What | Convention | Example |
|---|---|---|
| Resource names (DNS, IAM, CW) | kebab-case | catalyst-api-task-role |
| Terraform variables | snake_case | kms_key_arn |
| Terraform locals | snake_case | common_tags |
| Module directory names | kebab-case | s3-secure-bucket |
| Resource labels in HCL | this for the primary resource | aws_s3_bucket.this |
Every module merges caller-provided tags with mandatory defaults:
locals {
common_tags = merge(
{
Project = "catalyst"
Environment = var.environment
ManagedBy = "terraform"
Module = basename(path.module)
},
var.tags,
)
}
Per Platform Engineering for Architects Ch 8 (pp 271-275): tagging is not optional — it drives cost allocation, security scoping (aws:ResourceTag conditions), and observability dimensions.
# Never hardcode account ID or region
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
locals {
account_id = data.aws_caller_identity.current.account_id
region = data.aws_region.current.name
}
infrastructure/modules/leaf/s3-secure-bucket/
main.tf # Primary resource(s)
variables.tf # Input variables with validation
outputs.tf # Output contracts
versions.tf # required_providers + terraform version constraint
s3-secure-bucket.tftest.hcl # Native test file
README.md # One-paragraph description (auto-generated is fine)
# infrastructure/modules/composite/ecs-fargate-service/main.tf
module "log_group" {
source = "../../leaf/cw-log-group"
name = var.service_name
environment = var.environment
kms_key_arn = var.log_kms_key_arn
tags = local.common_tags
}
module "task_role" {
source = "../../leaf/iam-role"
name = "${var.service_name}-task-role"
trust_principal = "ecs-tasks.amazonaws.com"
policy_document = data.aws_iam_policy_document.task_permissions.json
tags = local.common_tags
}
module "execution_role" {
source = "../../leaf/iam-role"
name = "${var.service_name}-execution-role"
trust_principal = "ecs-tasks.amazonaws.com"
policy_document = data.aws_iam_policy_document.execution_permissions.json
tags = local.common_tags
}
# Task role != execution role — always separate (AGENTS.md §7)
# versions.tf
terraform {
required_version = ">= 1.10"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
main.tf + variables.tf + outputs.tf + versions.tf + .tftest.hclmodule blocks referencing leaf modules*.tfvars in git — environments use per-env files, gitignored.validation block.terraform fmt -check must pass — the CI gate enforces this.Source: Cloud-Byte-Consulting/Catalyst — distributed by TomeVault.