Loading...
Loading...
Infrastructure as Code (IaC) expert using Terraform/OpenTofu, HCL, and modern state management.
npx skill4agent add 404kidwiz/claude-supercode-skills terraform-engineer| Scale | Strategy | Backend |
|---|---|---|
| Individual | Local State | |
| Small Team | Remote State + Locking | |
| Enterprise | Managed State + Runs | Terraform Cloud / spacelift / env0 |
| GitOps | PR-driven Runs | Atlantis (Self-hosted) |
What are you building?
│
├─ **Root Module** (The "Glue")
│ ├─ `main.tf`: Instantiates child modules
│ ├─ `providers.tf`: Provider config
│ └─ `backend.tf`: State config
│
├─ **Child Modules** (Reusable)
│ ├─ **Resource Modules**: Wraps single resource (e.g., `s3-secure-bucket`)
│ │ └─ Enforces tagging, encryption, logging defaults.
│ │
│ └─ **Infrastructure Modules**: Logical group (e.g., `vpc-with-peering`)
│ └─ Combines VPC, Subnets, Route Tables, NAT Gateways.
│
└─ **Composition** (Terragrunt/Workspaces)
├─ `prod/`
├─ `stage/`
└─ `dev/`| Tool | Approach | Best For |
|---|---|---|
| Terraform | HCL (Declarative) | Industry standard, massive ecosystem. |
| Pulumi | General Purpose Lang (TS/Py) | Devs who hate HCL, dynamic logic. |
| Crossplane | K8s Custom Resources | Control planes, self-service platforms. |
| CloudFormation | YAML/JSON | AWS purists (drift detection is native). |
security-engineerproviderterraform.tfstate0.0.0.0/0versions.tfterraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}main.tfmodule "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.5.1"
name = "prod-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
enable_nat_gateway = true
single_nat_gateway = false # High Availability
enable_vpn_gateway = false
tags = {
Environment = "Production"
Terraform = "true"
}
}outputs.tfoutput "vpc_id" {
description = "The ID of the VPC"
value = module.vpc.vpc_id
}i-0123456789abcdef0resource "aws_instance" "legacy_server" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
# Fill in other known details...
}terraform import aws_instance.legacy_server i-0123456789abcdef0importimport {
to = aws_instance.legacy_server
id = "i-0123456789abcdef0"
}terraform planmain.tfterraform plannetworkdataapp-clusterterraform_remote_statevpc-prod.tfvpc-dev.tfterraform workspacevar.environmentprod.tfvarsdev.tfvars.gitignore.terraform/terraform.tfvars.gitignore.terraform/
*.tfstate
*.tfstate.backup
*.tfvars
.terraform.lock.hcl (Commit this one!)terraform fmt -recursiveterraform validatetflintterraform-docsencrypted = true~> 5.0destroy