EliasOulkadi/shokunin / .pack/skills/terraform
terraform
UnverifiedDesign and manage infrastructure as code with Terraform — modules, remote state (S3 + DynamoDB), Stacks (deployments), test framework, preconditions/postconditions, moved/removed blocks, and CI/CD plan/apply separation. Use when user asks to write Terraform config, set up remote state, design modules, manage state, or automate infrastructure. Do NOT use for Kubernetes (use kubernetes), Docker (use docker), or CI/CD pipeline design (use ci-cd).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.4 KB |
| assets/module-template/main.tf | other | 2.6 KB |
| assets/module-template/outputs.tf | other | 1.1 KB |
| assets/module-template/variables.tf | other | 2.7 KB |
| references/migration-patterns.md | markdown | 7.8 KB |
| references/stacks.md | markdown | 5.2 KB |
| scripts/plan-env.sh | script | 2.1 KB |
| scripts/validate-all.sh | script | 2.2 KB |
assets/module-template/variables.tf
View on GitHub# variables.tf — Module input variables with validation
variable "name" {
description = "Name prefix for all resources"
type = string
validation {
condition = can(regex("^[a-z][a-z0-9-]{2,62}$", var.name))
error_message = "Name must be 3-63 chars, start with lowercase letter, contain only lowercase letters, numbers, and hyphens."
}
}
variable "description" {
description = "Description of the KMS key"
type = string
default = "Managed by Terraform"
validation {
condition = length(var.description) <= 255
error_message = "Description must be 255 characters or fewer."
}
}
variable "deletion_window_in_days" {
description = "Waiting period before KMS key deletion"
type = number
default = 30
validation {
condition = var.deletion_window_in_days >= 7 && var.deletion_window_in_days <= 30
error_message = "Deletion window must be between 7 and 30 days."
}
}
variable "enable_key_rotation" {
description = "Enable automatic annual key rotation"
type = bool
default = true
}
variable "admin_principals" {
description = "IAM ARNs with administrative permissions on the key"
type = list(string)
default = []
validation {
condition = alltrue([
for arn in var.admin_principals : can(regex("^(arn:aws:iam::\\d{12}:role/|arn:aws:iam::\\d{12}:user/)", arn))
])
error_message = "Each admin principal must be a valid IAM role or user ARN."
}
}
variable "grant_principals" {
description = "IAM principals to grant KMS usage permissions"
type = list(string)
default = []
validation {
condition = alltrue([
for arn in var.grant_principals : can(regex("^arn:aws:iam::", arn))
])
error_message = "Each grant principal must be a valid IAM ARN."
}
}
variable "grant_operations" {
description = "KMS operations to grant"
type = list(string)
default = ["Encrypt", "Decrypt", "GenerateDataKey"]
validation {
condition = alltrue([
for op in var.grant_operations : contains([
"Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext",
"ReEncryptFrom", "ReEncryptTo", "RetireGrant", "Sign", "Verify",
"CreateGrant", "DescribeKey",
], op)
])
error_message = "Each operation must be a valid KMS grant operation."
}
}
variable "tags" {
description = "Resource tags"
type = map(string)
default = {}
validation {
condition = alltrue([
for k, v in var.tags : can(regex("^[a-zA-Z0-9 _\\.:/+=@-]{1,128}$", k)) && can(regex("^[a-zA-Z0-9 _\\.:/+=@-]{0,256}$", v))
])
error_message = "Tag keys (128 chars) and values (256 chars) must contain only valid characters."
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |