terraform-engineer
Skill này làm gì
Skill hướng dẫn AI viết code hạ tầng có thể tái sử dụng, quản lý state và xem lại plan trước khi thay đổi. Skill dành cho kỹ sư quản lý thiết lập đám mây.
Khi nào nên dùng
- ✓Khi bạn muốn viết module Terraform cho AWS, Azure hoặc Google Cloud.
- ✓Khi bạn cần chuyển state Terraform sang backend từ xa hoặc import tài nguyên có sẵn.
- ✓Khi bạn muốn xem lại plan Terraform trước khi nó thay đổi hạ tầng thật.
Liên kết skill
https://github.com/Jeffallan/claude-skills/blob/main/skills/terraform-engineer/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể viết code Terraform cho một bucket lưu trữ an toàn trên AWS và cho tôi xem plan không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết code, chạy các kiểm tra định dạng và xác thực, tóm tắt plan, rồi chờ bạn duyệt trước khi áp dụng bất cứ thứ gì.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Terraform Engineer
Senior Terraform engineer specializing in infrastructure as code across AWS, Azure, and GCP with expertise in modular design, state management, and production-grade patterns.
Core Workflow
- Analyze infrastructure — Review requirements, existing code, cloud platforms
- Design modules — Create composable, validated modules with clear interfaces
- Implement state — Configure remote backends with locking and encryption
- Secure infrastructure — Apply security policies, least privilege, encryption
- Validate — Run
terraform fmtandterraform validate, thentflint; if any errors are reported, fix them and re-run until all checks pass cleanly before proceeding - Plan and review — Run
terraform plan -out=tfplanand extract a summarized plan highlighting creates, updates, deletes, and especially any destructive actions (recreations or deletions); if the plan fails, see error recovery below - Approve and apply — Present the plan summary to the user and ask for explicit approval. Only execute
terraform apply tfplanafter receiving confirmation. Refuse to apply the plan if approval is withheld, or if destructive changes are present and the user has not explicitly accepted them
Error Recovery
Validation 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):
- State drift — Run
terraform refreshto reconcile state with real resources, or useterraform state rm/terraform importto realign specific resources, then re-plan. - Provider auth errors — Verify credentials, environment variables, and provider configuration blocks; re-run
terraform initif provider plugins are stale, then re-plan. - Dependency / ordering errors — Add explicit
depends_onreferences 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.
Reference Guide
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 |
DRY patterns, naming, security, cost tracking |
Constraints
MUST DO
- Use semantic versioning and pin provider versions
- Enable remote state with locking and encryption
- Validate inputs with validation blocks
- Use consistent naming conventions and tag all resources
- Document module interfaces
- Run
terraform fmtandterraform validate
MUST NOT DO
- Store secrets in plain text or hardcode environment-specific values
- Use local state for production or skip state locking
- Mix provider versions without constraints
- Create circular module dependencies or skip input validation
- Commit
.terraformdirectories
Code Examples
Minimal Module Structure
main.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
}
Remote Backend Configuration (S3 + DynamoDB)
terraform {
backend "s3" {
bucket = "my-tf-state"
key = "env/prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-lock"
}
}
Provider Version Pinning
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
}
}
Output Format
When implementing Terraform soluti
Câu hỏi thường gặp
Nó có áp dụng thay đổi mà không hỏi không?
Không. Skill yêu cầu hiển thị tóm tắt plan và chờ bạn duyệt rõ ràng trước khi chạy apply.
Nó bao quát những đám mây nào?
Nó bao quát AWS, Azure và GCP.
Nó chạy những kiểm tra nào trước khi lên plan?
Nó chạy terraform fmt, terraform validate và tflint, rồi sửa mọi lỗi chúng báo.
Chi tiết
Mô tả gốc của tác giả
Use when implementing infrastructure as code with Terraform across AWS, Azure, or GCP. Invoke for module development (create reusable modules, manage module versioning), state management (migrate backends, import existing resources, resolve state conflicts), provider configuration, multi-environment workflows, and infrastructure testing.
repo: Jeffallan/claude-skills
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11463
- Giấy phép
- MIT
- Cập nhật
- 30/10/2026
Bình luận
- …
Thêm skill từ kho mã này
angular-architect
12kGiúp agent của bạn xây ứng dụng Angular 17 trở lên với standalone component, định tuyến lazy-loaded, state NgRx, mẫu RxJS và tinh chỉnh hiệu năng.
api-designer
12kGiúp agent của bạn thiết kế API REST hoặc GraphQL và viết đặc tả OpenAPI 3.1, với quy tắc cho tài nguyên, phân trang, định dạng lỗi và phiên bản.
architecture-designer
12kGiúp agent của bạn thiết kế kiến trúc hệ thống, so sánh các mẫu và công nghệ, và viết Architecture Decision Record giải thích từng lựa chọn.
atlassian-mcp
12kGiúp agent của bạn tìm kiếm và cập nhật issue Jira cùng trang Confluence qua MCP, gồm truy vấn JQL và CQL, sprint và đồng bộ tài liệu.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.