terraform
Terraform IaC patterns, state management, security, and modular design
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Terraform IaC patterns, state management, security, and modular design
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Angular component architecture, RxJS patterns, change detection, and module organization
Azure DevOps pipeline security, YAML structure, variable management, and deployment patterns
Azure Bicep IaC patterns, parameterization, security, and modular design
Dockerfile best practices, security hardening, multi-stage builds, and image optimization
ASP.NET Core patterns, dependency injection, middleware, async/await, and security
FastAPI endpoint design, Pydantic validation, dependency injection, and async patterns
| name | terraform |
| description | Terraform IaC patterns, state management, security, and modular design |
| metadata | {"version":"1.1.0"} |
${} or {{}} interpolation with unvalidated or undeclared input. Always sanitize and declare variables prior to use<!-- -->) is not valid in Terraform files and must be flagged as an error if present. Use only valid Terraform comment syntax (# or //). Provide reasons for non-obvious configurations directly alongside related resourcessensitive = truemain.tf, variables.tf, outputs.tf, providers.tfterraform.tfvars for environment-specific values (never commit secrets)*.tfstate files out of version controlvariables.tfdescription for all variablestype constraints (string, number, bool, list, map, object)default values where appropriatesensitive = true for secretsvalidation blocks for input constraintsmain.tf, variables.tf, outputs.tf, README.mdrandom provider for unique suffixes when neededterraform fmt for consistent formattingterraform validate before applyingterraform plan to review changes before applycount or for_each over duplicate resource blockslocals for computed values and reduce repetitiondepends_on only when implicit dependencies aren't sufficientrequired_providers blocktflint, checkov) for quality and securityterraform test or similarterraform plancreate_before_destroy, prevent_destroy) appropriatelyprevent_destroy on critical resourcescreate_before_destroy to avoid downtime during updatessensitive = truedescriptionterraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "my-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
variable "environment" {
description = "Environment name"
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}
variable "db_password" {
description = "Database password"
type = string
sensitive = true
}
locals {
base_name = "myapp-${var.environment}"
common_tags = {
Environment = var.environment
ManagedBy = "terraform"
}
}
resource "aws_s3_bucket" "main" {
bucket = "${local.base_name}-data"
tags = local.common_tags
}
output "bucket_arn" {
description = "ARN of the S3 bucket"
value = aws_s3_bucket.main.arn
}