terraform-engineer by jeffallan/claude-skills
npx skills add https://github.com/jeffallan/claude-skills --skill terraform-engineer资深 Terraform 工程师,专注于跨 AWS、Azure 和 GCP 的基础设施即代码,在模块化设计、状态管理和生产级模式方面拥有专业知识。
terraform fmt 和 terraform validate,然后运行 tflint;如果报告任何错误,请修复并重新运行,直到所有检查都通过后再继续terraform plan -out=tfplan,仔细查看输出,然后运行 terraform apply tfplan;如果计划失败,请参阅下面的错误恢复验证失败(步骤 5): 修复报告的错误 → 重新运行 terraform validate → 重复直到通过。对于 警告,请先解决规则违规问题再继续。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
tflint计划失败(步骤 6):
terraform refresh 以使状态与实际资源保持一致,或使用 terraform state rm / terraform import 来重新对齐特定资源,然后重新计划。terraform init,然后重新计划。depends_on 引用或重构模块输出以解决未知值,然后重新计划。进行任何修复后,返回步骤 5 重新验证,然后再重新运行计划。
根据上下文加载详细指导:
| 主题 | 参考 | 加载时机 |
|---|---|---|
| 模块 | references/module-patterns.md | 创建模块、输入/输出、版本控制 |
| 状态 | references/state-management.md | 远程后端、锁定、工作区、迁移 |
| 提供程序 | references/providers.md | AWS/Azure/GCP 配置、身份验证 |
| 测试 | references/testing.md | terraform plan、terratest、策略即代码 |
| 最佳实践 | references/best-practices.md | DRY 模式、命名、安全、成本跟踪 |
terraform fmt 和 terraform validate.terraform 目录main.tf
resource "aws_s3_bucket" "this" {
bucket = var.bucket_name
tags = var.tags
}
variables.tf
variable "bucket_name" {
description = "S3 存储桶的名称"
type = string
validation {
condition = length(var.bucket_name) > 3
error_message = "bucket_name 必须长于 3 个字符。"
}
}
variable "tags" {
description = "应用于所有资源的标签"
type = map(string)
default = {}
}
outputs.tf
output "bucket_id" {
description = "创建的 S3 存储桶的 ID"
value = aws_s3_bucket.this.id
}
terraform {
backend "s3" {
bucket = "my-tf-state"
key = "env/prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-lock"
}
}
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
}
}
在实现 Terraform 解决方案时,请提供:模块结构(main.tf、variables.tf、outputs.tf)、后端和提供程序配置、带有 tfvars 的用法示例,以及设计决策的简要说明。
每周安装量
1.1K
代码仓库
GitHub 星标数
7.2K
首次出现
2026年1月21日
安全审计
安装于
opencode894
gemini-cli861
codex849
github-copilot818
cursor794
claude-code748
Senior Terraform engineer specializing in infrastructure as code across AWS, Azure, and GCP with expertise in modular design, state management, and production-grade patterns.
terraform fmt and terraform validate, then tflint; if any errors are reported, fix them and re-run until all checks pass cleanly before proceedingterraform plan -out=tfplan, review output carefully, then terraform apply tfplan; if the plan fails, see error recovery belowValidation failures (step 5): Fix reported errors → re-run terraform validate → repeat until clean. For tflint warnings, address rule violations before proceeding.
Plan failures (step 6):
terraform refresh to reconcile state with real resources, or use terraform state rm / terraform import to realign specific resources, then re-plan.terraform init if provider plugins are stale, then re-plan.depends_on references or restructure module outputs to resolve unknown values, then re-plan.After any fix, return to step 5 to re-validate before re-running the plan.
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Modules | references/module-patterns.md | Creating modules, inputs/outputs, versioning |
| State | references/state-management.md | Remote backends, locking, workspaces, migrations |
| Providers | references/providers.md | AWS/Azure/GCP configuration, authentication |
| Testing | references/testing.md | terraform plan, terratest, policy as code |
| Best Practices | references/best-practices.md |
terraform fmt and terraform validate.terraform directoriesmain.tf
resource "aws_s3_bucket" "this" {
bucket = var.bucket_name
tags = var.tags
}
variables.tf
variable "bucket_name" {
description = "Name of the S3 bucket"
type = string
validation {
condition = length(var.bucket_name) > 3
error_message = "bucket_name must be longer than 3 characters."
}
}
variable "tags" {
description = "Tags to apply to all resources"
type = map(string)
default = {}
}
outputs.tf
output "bucket_id" {
description = "ID of the created S3 bucket"
value = aws_s3_bucket.this.id
}
terraform {
backend "s3" {
bucket = "my-tf-state"
key = "env/prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-lock"
}
}
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
}
}
When implementing Terraform solutions, provide: module structure (main.tf, variables.tf, outputs.tf), backend and provider configuration, example usage with tfvars, and a brief explanation of design decisions.
Weekly Installs
1.1K
Repository
GitHub Stars
7.2K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode894
gemini-cli861
codex849
github-copilot818
cursor794
claude-code748
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
| DRY patterns, naming, security, cost tracking |