[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CXR1ZR3PR3E3SDJE7M284A":3,"skill-same:01M6CXR1ZR3PR3E3SDJE7M284A":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":36,"commitSha":37,"skillDirectory":5,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M6CXR1ZR3PR3E3SDJE7M284A","terraform",null,"Terraform Infrastructure as Code best practices","ffsshhttiikk\u002Fopencode-agents-skills","ffsshhttiikk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F226346827?v=4","01M6CWD9RR3Y7VRQX3MXYC8FYH","01M6CWD9WVPYAZW0J82G1VKGHY",3,"MIT","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fterraform\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[5,23,24,25,26,27,28],"infrastructure","code","best practices","infrastructure as code","devops","opencode","2026-11-10 10:12:30",false,"---\nname: terraform\ndescription: Terraform Infrastructure as Code best practices\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: developers\n  category: devops\n---\n## What I do\n- Write Terraform configurations for cloud infrastructure\n- Manage state files and backends\n- Use modules for reusable infrastructure\n- Implement remote state with locking\n- Handle secrets with Vault or cloud providers\n- Use workspaces for environment management\n- Implement CI\u002FCD for Terraform\n- Follow security best practices\n\n## When to use me\nWhen creating Terraform configurations or managing cloud infrastructure.\n\n## Terraform Structure\n```\nterraform\u002F\n├── environments\u002F\n│   ├── prod\u002F\n│   │   ├── main.tf\n│   │   ├── variables.tf\n│   │   ├── outputs.tf\n│   │   └── terraform.tfvars\n│   ├── staging\u002F\n│   │   └── ...\n│   └── dev\u002F\n│       └── ...\n├── modules\u002F\n│   ├── networking\u002F\n│   │   ├── main.tf\n│   │   ├── variables.tf\n│   │   └── outputs.tf\n│   ├── compute\u002F\n│   │   └── ...\n│   └── database\u002F\n│       └── ...\n└── global\u002F\n    └── s3\u002F\n        └── ...\n```\n\n## Main Configuration\n```hcl\nterraform {\n  required_version = \">= 1.5.0\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp\u002Faws\"\n      version = \"~> 5.0\"\n    }\n    random = {\n      source  = \"hashicorp\u002Frandom\"\n      version = \"~> 3.5\"\n    }\n  }\n\n  # Remote state with locking\n  backend \"s3\" {\n    bucket         = \"my-terraform-state\"\n    key            = \"environments\u002Fprod\u002Fterraform.tfstate\"\n    region         = \"us-east-1\"\n    encrypt        = true\n    dynamodb_table = \"terraform-locks\"\n  }\n}\n\nprovider \"aws\" {\n  region = var.aws_region\n\n  default_tags {\n    tags = {\n      Environment = var.environment\n      ManagedBy   = \"terraform\"\n      Project     = var.project_name\n    }\n  }\n}\n\n# Variables\nvariable \"aws_region\" {\n  description = \"AWS region\"\n  type        = string\n  default     = \"us-east-1\"\n}\n\nvariable \"environment\" {\n  description = \"Environment name\"\n  type        = string\n  validation {\n    condition     = contains([\"dev\", \"staging\", \"prod\"], var.environment)\n    error_message = \"Environment must be dev, staging, or prod.\"\n  }\n}\n\nvariable \"vpc_cidr\" {\n  description = \"VPC CIDR block\"\n  type        = string\n  default     = \"10.0.0.0\u002F16\"\n}\n\n# Use workspaces for environment separation\n# terraform workspace new prod\n# terraform workspace select prod\n```\n\n## VPC Module\n```hcl\n# modules\u002Fnetworking\u002Fmain.tf\nresource \"aws_vpc\" \"main\" {\n  cidr_block           = var.vpc_cidr\n  enable_dns_hostnames = true\n  enable_dns_support   = true\n\n  tags = {\n    Name        = \"${var.environment}-vpc\"\n    Environment = var.environment\n  }\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  vpc_id = aws_vpc.main.id\n\n  tags = {\n    Name = \"${var.environment}-igw\"\n  }\n}\n\nresource \"aws_subnet\" \"public\" {\n  count                   = length(var.public_subnet_cidrs)\n  vpc_id                  = aws_vpc.main.id\n  cidr_block              = var.public_subnet_cidrs[count.index]\n  availability_zone       = var.availability_zones[count.index]\n  map_public_ip_on_launch = true\n\n  tags = {\n    Name = \"${var.environment}-public-${count.index + 1}\"\n  }\n}\n\nresource \"aws_subnet\" \"private\" {\n  count             = length(var.private_subnet_cidrs)\n  vpc_id            = aws_vpc.main.id\n  cidr_block       = var.private_subnet_cidrs[count.index]\n  availability_zone = var.availability_zones[count.index]\n\n  tags = {\n    Name = \"${var.environment}-private-${count.index + 1}\"\n  }\n}\n\nresource \"aws_nat_gateway\" \"main\" {\n  count         = length(var.public_subnet_cidrs)\n  subnet_id     = aws_subnet.public[count.index].id\n  allocation_id = aws_eip.nat[count.index].id\n\n  tags = {\n    Name = \"${var.environment}-nat-${count.index + 1}\"\n  }\n}\n\nresource \"aws_eip\" \"nat\" {\n  count = length(var.public_subnet_cidrs)\n  vpc   = true\n}\n```\n\n## EC2 and Auto Scaling\n```hcl\nresource \"aws_launch_template\" \"app\" {\n  name_prefix   = \"${var.environment}-app\"\n  image_id      = data.aws_ami.amazon_linux.id\n  instance_type = var.instance_type\n  key_name      = var.ssh_key_name\n\n  vpc_security_group_ids = [aws_security_group.app.id]\n\n  user_data = base64encode(templatefile(\"${path.module}\u002Fuser-data.sh\", {\n    environment = var.environment\n    api_key     = var.api_key\n  }))\n\n  iam_instance_profile {\n    name = aws_iam_instance_profile.app.name\n  }\n\n  tag_specifications {\n    resource_type = \"instance\"\n    tags = {\n      Name        = \"${var.environment}-app\"\n      Environment = var.environment\n    }\n  }\n}\n\nresource \"aws_autoscaling_group\" \"app\" {\n  name                = \"${var.environment}-app-asg\"\n  vpc_zone_identifier = module.vpc.private_subnet_ids\n  target_group_arns   = [aws_lb_target_group.app.arn]\n\n  launch_template {\n    id      = aws_launch_template.app.id\n    version = \"$Latest\"\n  }\n\n  min_size         = var.min_size\n  max_size         = var.max_size\n  desired_capacity = var.desired_capacity\n\n  health_check_type         = \"ELB\"\n  health_check_grace_period = 300\n\n  lifecycle {\n    create_before_destroy = true\n  }\n\n  tag {\n    key                 = \"Name\"\n    value               = \"${var.environment}-app\"\n    propagate_at_launch = true\n  }\n}\n```\n\n## Terraform Workflow\n```bash\n# Initialize and plan\nterraform init\nterraform plan -var-file=\"environments\u002Fprod\u002Fterraform.tfvars\"\n\n# Apply with approval\nterraform apply -var-file=\"environments\u002Fprod\u002Fterraform.tfvars\"\n\n# Format and validate\nterraform fmt -recursive\nterraform validate\nterraform plan -detailed-exitcode\n\n# State management\nterraform state list\nterraform state mv aws_instance.old aws_instance.new\nterraform state rm aws_instance.deprecated\n\n# Workspaces\nterraform workspace list\nterraform workspace new staging\nterraform workspace select prod\n\n# Import existing resources\nterraform import aws_instance.existing i-1234567890abcdef0\n\n# Destroy\nterraform destroy -var-file=\"environments\u002Fdev\u002Fterraform.tfvars\"\n```\n","## What I do\n- Write Terraform configurations for cloud infrastructure\n- Manage state files and backends\n- Use modules for reusable infrastructure\n- Implement remote state with locking\n- Handle secrets with Vault or cloud providers\n- Use workspaces for environment management\n- Implement CI\u002FCD for Terraform\n- Follow security best practices\n\n## When to use me\nWhen creating Terraform configurations or managing cloud infrastructure.\n\n## Terraform Structure\n```\nterraform\u002F\n├── environments\u002F\n│   ├── prod\u002F\n│   │   ├── main.tf\n│   │   ├── variables.tf\n│   │   ├── outputs.tf\n│   │   └── terraform.tfvars\n│   ├── staging\u002F\n│   │   └── ...\n│   └── dev\u002F\n│       └── ...\n├── modules\u002F\n│   ├── networking\u002F\n│   │   ├── main.tf\n│   │   ├── variables.tf\n│   │   └── outputs.tf\n│   ├── compute\u002F\n│   │   └── ...\n│   └── database\u002F\n│       └── ...\n└── global\u002F\n    └── s3\u002F\n        └── ...\n```\n\n## Main Configuration\n```hcl\nterraform {\n  required_version = \">= 1.5.0\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp\u002Faws\"\n      version = \"~> 5.0\"\n    }\n    random = {\n      source  = \"hashicorp\u002Frandom\"\n      version = \"~> 3.5\"\n    }\n  }\n\n  # Remote state with locking\n  backend \"s3\" {\n    bucket         = \"my-terraform-state\"\n    key            = \"environments\u002Fprod\u002Fterraform.tfstate\"\n    region         = \"us-east-1\"\n    encrypt        = true\n    dynamodb_table = \"terraform-locks\"\n  }\n}\n\nprovider \"aws\" {\n  region = var.aws_region\n\n  default_tags {\n    tags = {\n      Environment = var.environment\n      ManagedBy   = \"terraform\"\n      Project     = var.project_name\n    }\n  }\n}\n\n# Variables\nvariable \"aws_region\" {\n  description = \"AWS region\"\n  type        = string\n  default     = \"us-east-1\"\n}\n\nvariable \"environment\" {\n  description = \"Environment name\"\n  type        = string\n  validation {\n    condition     = contains([\"dev\", \"staging\", \"prod\"], var.environment)\n    error_message = \"Environment must be dev, staging, or prod.\"\n  }\n}\n\nvariable \"vpc_cidr\" {\n  description = \"VPC CIDR block\"\n  type        = string\n  default     = \"10.0.0.0\u002F16\"\n}\n\n# Use workspaces for environment separation\n# terraform workspace new prod\n# terraform workspace select prod\n```\n\n## VPC Module\n```hcl\n# modules\u002Fnetworking\u002Fmain.tf\nresource \"aws_vpc\" \"main\" {\n  cidr_block           = var.vpc_cidr\n  enable_dns_hostnames = true\n  enable_dns_support   = true\n\n  tags = {\n    Name        = \"${var.environment}-vpc\"\n    Environment = var.environment\n  }\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  vpc_id = aws_vpc.main.id\n\n  tags = {\n    Name = \"${var.environment}-igw\"\n  }\n}\n\nresource \"aws_subnet\" \"public\" {\n  count                   = length(var.public_subnet_cidrs)\n  vpc_id                  = aws_vpc.main.id\n  cidr_block              = var.public_subnet_cidrs[count.index]\n  availability_zone       = var.availability_zones[count.index]\n  map_public_ip_on_launch = true\n\n  tags = {\n    Name = \"${var.environment}-public-${count.index + 1}\"\n  }\n}\n\nresource \"aws_subnet\" \"private\" {\n  count             = length(var.private_subnet_cidrs)\n  vpc_id            = aws_vpc.main.id\n  cidr_block       = var.private_subnet_cidrs[count.index]\n  availability_zone = var.availability_zones[count.index]\n\n  tags = {\n    Name = \"${var.environment}-private-${count.index + 1}\"\n  }\n}\n\nresource \"aws_nat_gateway\" \"main\" {\n  count         = length(var.public_subnet_cidrs)\n  subnet_id     = aws_subnet.public[count.index].id\n  allocation_id = aws_eip.nat[count.index].id\n\n  tags = {\n    Name = \"${var.environment}-nat-${count.index + 1}\"\n  }\n}\n\nresource \"aws_eip\" \"nat\" {\n  count = length(var.public_subnet_cidrs)\n  vpc   = true\n}\n```\n\n## EC2 and Auto Scaling\n```hcl\nresource \"aws_launch_template\" \"app\" {\n  name_prefix   = \"${var.environment}-app\"\n  image_id      = data.aws_ami.amazon_linux.id\n  instance_type = var.instance_type\n  key_name      = var.ssh_key_name\n\n  vpc_security_group_ids = [aws_security_group.app.id]\n\n  user_data = base64encode(templatefile(\"${path.module}\u002Fuser-data.sh\", {\n    environment = var.environment\n    api_key     = var.api_key\n  }))\n\n  iam_instance_profile {\n    name = aws_iam_instance_profile.app.name\n  }\n\n  tag_specifications {\n    resource_type = \"instance\"\n    tags = {\n      Name        = \"${var.environment}-app\"\n      Environment = var.environment\n    }\n  }\n}\n\nresource \"aws_autoscaling_group\" \"app\" {\n  name                = \"${var.environment}-app-asg\"\n  vpc_zone_identifier = module.vpc.private_subnet_ids\n  target_group_arns   = [aws_lb_target_group.app.arn]\n\n  launch_template {\n    id      = aws_launch_template.app.id\n    version = \"$Latest\"\n  }\n\n  min_size         = var.min_size\n  max_size         = var.max_size\n  desired_capacity = var.desired_capacity\n\n  health_check_type         = \"ELB\"\n  health_check_grace_period = 300\n\n  lifecycle {\n    create_before_destroy = true\n  }\n\n  tag {\n    key                 = \"Name\"\n    value               = \"${var.environment}-app\"\n    propagate_at_launch = true\n  }\n}\n```\n\n## Terraform Workflow\n```bash\n# Initialize and plan\nterraform init\nterraform plan -var-file=\"environments\u002Fprod\u002Fterraform.tfvars\"\n\n# Apply with approval\nterraform apply -var-file=\"environments\u002Fprod\u002Fterraform.tfvars\"\n\n# Format and validate\nterraform fmt -recursive\nterraform validate\nterraform plan -detailed-exitcode\n\n# State management\nterraform state list\nterraform state mv aws_instance.old aws_instance.new\nterraform state rm aws_instance.deprecated\n\n# Workspaces\nterraform workspace list\nterraform workspace new staging\nterraform workspace select prod\n\n# Import existing resources\nterraform import aws_instance.existing i-1234567890abcdef0\n\n# Destroy\nterraform destroy -var-file=\"environments\u002Fdev\u002Fterraform.tfvars\"\n```\n",{"name":5,"license":14,"metadata":34,"description":7,"compatibility":28},{"audience":35,"category":27},"developers","main","5f7a3e453c98261f93d19a6a7de44ad8f7b72d41",2,"https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk","2026-03-01 06:55:40",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill terraform",{"tool":48,"command":49},"bunx","bunx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill terraform",{"tool":51,"command":52},"pnpm","pnpm dlx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill terraform","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fterraform\u002FSKILL.md",true,[],[57,68,78,87,97,106],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":29},"01M6CXT9TXDF79BWJTMQAPB49G","xamarin","Xamarin cross-platform development","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fxamarin\u002FSKILL.md",[],[59,64,65,66,28,67],"platform","cross-platform","mobile","development",{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":29},"01M6CXT8AD04MFYDA32VW3FKAG","wrangling","Data wrangling fundamentals","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwrangling\u002FSKILL.md",[],[70,75,28,76,77],"data wrangling","science","data",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":29},"01M6CXT717GCN7SRRNPBDP4508","windows","Windows operating system administration and scripting","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwindows\u002FSKILL.md",[],[80,85,28,86],"system","scripting",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":29},"01M6CXT54K794NMEM3XAPZZDKT","wide-column","Wide-column data model","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column\u002FSKILL.md",[],[94,95,28,96,77],"wide column","databases","model",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":29},"01M6CXT28FMT2P4V9GZE67WA8E","wide-column-stores","Wide-column database stores","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column-stores\u002FSKILL.md",[],[104,95,28,105],"wide column stores","database",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":29},"01M6CXT0D0M0Q4T2N7C2RX7DSN","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwebsockets\u002FSKILL.md",[],[108,113,114,115,28,25,116],"websocket","real-time","time","implementation"]