用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/UitbreidenOS/UitKit --skill terraform命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Guidelines and instructions for Agent execution state rollback rules
Guidelines and instructions for Agent execution step counters limits
Guidelines and instructions for Agent execution timeout limits setups
基于 SOC 职业分类
正在显示 SKILL.md
| name | terraform |
| description | Terraform modules, state management, workspaces, provider config, plan/apply workflow, remote backends |
terraform plan and terraform applyEvery Terraform project must follow this structure:
infrastructure/
├── modules/
│ ├── networking/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ ├── outputs.tf
│ │ └── versions.tf
│ └── compute/
│ ├── main.tf
│ ├── variables.tf
│ └── outputs.tf
├── environments/
│ ├── production/
│ │ ├── main.tf ← calls modules
│ │ ├── variables.tf
│ │ ├── terraform.tfvars
│ │ └── backend.tf
│ └── staging/
│ └── ...
└── versions.tf ← root provider versions
# backend.tf
terraform {
backend "s3" {
bucket = "company-terraform-state"
key = "production/networking/terraform.tfstate"
region = "eu-west-1"
encrypt = true
dynamodb_table = "terraform-state-lock"
}
}
# variables.tf — always include description and type
variable "environment" {
description = "Deployment environment (production, staging, development)"
type = string
validation {
condition = contains(["production", "staging", "development"], var.environment)
error_message = "Environment must be production, staging, or development."
}
}
# outputs.tf — output everything a consuming module might need
output "vpc_id" {
description = "The ID of the VPC"
value = aws_vpc.main.id
}
terraform.tfvars or hardcode them in .tf filesdata "aws_secretsmanager_secret_version" or data "google_secret_manager_secret_version" to read secrets at apply timesensitive = true to suppress in plan output.gitignore must include: *.tfvars, *.tfstate, *.tfstate.backup, .terraform/# Consistent naming: {project}-{environment}-{resource}-{suffix}
resource "aws_vpc" "main" {
cidr_block = var.vpc_cidr
tags = {
Name = "${var.project}-${var.environment}-vpc"
Environment = var.environment
ManagedBy = "terraform"
}
}
Always tag every resource with Environment and ManagedBy = "terraform".
terraform plan -out=tfplan on PR, terraform apply tfplan on mergeterraform apply without a saved plan in production-target sparingly — it creates drift between real state and planterraform destroy with no -target destroys everything — always confirm scope~> 5.0 not >= 5.0count vs for_each: use for_each with maps — count causes index drift when items are removedUser: Create a Terraform module for a private RDS PostgreSQL instance on AWS with Multi-AZ, encrypted storage, and a dedicated security group.
Expected output structure:
modules/rds/main.tf — aws_db_instance, aws_db_subnet_group, aws_security_groupmodules/rds/variables.tf — instance class, engine version, db name, VPC/subnet IDs, ingress CIDRmodules/rds/outputs.tf — endpoint, port, security group IDstorage_encrypted = true, multi_az = true, deletion_protection = true for productionaws_secretsmanager_secret reference, never hardcoded