跳到正文
Skillpedia
部署与云(DevOps)48k · #5960

terraform-aws

它能做什么

这个工具可以帮你使用 Terraform 这种代码,在亚马逊云(AWS)上创建和管理资源。你可以把它理解为:给 AWS 下达指令,让它帮你搭建并维护基础设施。

适用场景

  • ✓当你需要在 AWS 中创建服务器、网络或数据库时。
  • ✓当你想整理并自动化 AWS 基础设施的搭建过程时。
  • ✓当你需要确保 AWS 基础设施始终保持一致时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/terraform-aws/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/terraform-aws/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“用 Terraform 在 AWS 中创建一个虚拟网络(VPC)和一台 Web 服务器。”

每周 5 个新技能,1 分钟读完。

工作原理

你用代码描述想在 AWS 中实现的效果。Terraform 读取这些代码,并与 AWS 通信,按照你的要求精确地创建或修改资源。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

When to Use

  • Provisioning, hardening, or operating the infrastructure described in this skill within an authorized environment.

Terraform AWS

Provision and manage AWS infrastructure with Terraform.

Provider Configuration

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
  
  backend "s3" {
    bucket = "terraform-state"
    key    = "prod/terraform.tfstate"
    region = "us-east-1"
  }
}

provider "aws" {
  region = var.region
  
  default_tags {
    tags = {
      Environment = var.environment
      ManagedBy   = "terraform"
    }
  }
}

Example Resources

resource "aws_vpc" "main" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_hostnames = true
  
  tags = { Name = "main-vpc" }
}

resource "aws_instance" "web" {
  ami           = data.aws_ami.amazon_linux.id
  instance_type = "t3.micro"
  subnet_id     = aws_subnet.public.id
  
  tags = { Name = "web-server" }
}

Modules

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"
  
  name = "my-vpc"
  cidr = "10.0.0.0/16"
  
  azs             = ["us-east-1a", "us-east-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]
  
  enable_nat_gateway = true
}

Commands

terraform init
terraform plan -out=plan.tfplan
terraform apply plan.tfplan
terraform destroy

Best Practices

  • Use remote state with locking
  • Implement module structure
  • Use workspaces or separate states per environment
  • Pin provider versions
  • Use data sources for AMIs

Related Skills

  • aws-vpc (aws-vpc) - VPC networking
  • aws-iam (aws-iam) - IAM policies

When to Use

  • You are provisioning, configuring, or troubleshooting the infrastructure component covered by this skill (servers, storage, databases, networking, cloud, local AI).

Limitations

  • Infrastructure commands can disrupt services: confirm target host/scope and have backups/snapshots before mutating state.
  • Docs-only import: upstream scripts and templates not bundled.
常见问题

什么是 Terraform?

Terraform 是一个工具,让你能够用代码描述和管理云端基础设施(比如服务器和网络),而且过程安全、结果可预期。

什么是 AWS?

AWS(亚马逊云科技)是亚马逊推出的一套云计算服务,包括存储、计算能力和数据库等。

云端的“资源”是什么?

资源是你在云端使用的各种组件,比如虚拟机(服务器)、存储空间、网络、数据库等。

详情

作者的原始描述

Provision AWS infrastructure with Terraform. Create modules, manage state, and implement IaC best practices. Use when deploying AWS resources declaratively.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5960
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能