Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

terraformTerraform 基础设施

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

399

周安装

16

GitHub Stars

4

下载量

129
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:terraform(Terraform 基础设施)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/terraform
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill terraform
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill terraform

简介

terraform 用于基于声明式配置管理云基础设施,实现资源的版本化部署与维护。

  • 适用于多云平台(如 AWS、Azure、GCP)的自动化 provisioning 和 CI/CD 流程集成。
  • 支持创建、更新和销毁资源,提供重复性操作与灾难恢复能力。
  • 安装后可通过 HCL 文件定义环境,需确保账号权限与环境隔离。
  • 生产操作前应验证配置变更影响,避免误删关键服务或网络配置。

SKILL.md

terraform

Purpose

Terraform is a command-line tool for defining and provisioning infrastructure as code using declarative HCL (HashiCorp Configuration Language) files. It enables users to create, update, and destroy cloud resources in a repeatable, version-controlled manner.

When to Use

Use Terraform for managing multi-cloud environments, automating infrastructure deployments, or when you need version-controlled IaC for resources like VMs, networks, or databases. Apply it in scenarios involving AWS, Azure, or GCP provisioning, especially for dynamic scaling, disaster recovery setups, or CI/CD pipelines to ensure consistency.

Key Capabilities

  • Declarative HCL syntax for defining resources, e.g., resource "aws_instance" "example" {ami = "ami-123456" instance_type = "t2.micro"}.
  • Provider support for over 100 services; configure with blocks like provider "aws" {region = "us-west-2"}.
  • State management via local files or remote backends (e.g., S3) to track resource changes.
  • Module reuse for composing configurations; import with module "vpc" {source = "./modules/vpc"}.
  • Variable interpolation and functions, such as count for loops or templatefile for dynamic configs.

Usage Patterns

To use Terraform, start by writing an HCL file (e.g., main.tf) defining resources and providers. Initialize the workspace with terraform init, review changes via terraform plan, and apply them with terraform apply. For automation, wrap commands in scripts and use environment variables for secrets. Always version control your.tf files in Git. For multi-environment setups, use workspaces: terraform workspace new dev then switch with terraform workspace select dev.

Common Commands/API

Run Terraform via CLI; key commands include:

  • terraform init: Download providers and modules; use -upgrade to update dependencies.
  • terraform plan -out=plan.tfplan -var="instance_type=t2.medium": Generate an execution plan; specify variables via flags or files.
  • terraform apply plan.tfplan: Apply the plan; add -auto-approve for non-interactive runs.
  • terraform destroy -target=aws_instance.example: Destroy specific resources; use -force cautiously. For API integration, use Terraform's remote backend or the Terraform Cloud API (e.g., POST to https://app.terraform.io/api/v2/runs for runs), but require authentication via $TERRAFORM_TOKEN. Set provider credentials as env vars, e.g., export AWS_ACCESS_KEY_ID=$AWS_API_KEY and export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY.

Integration Notes

Integrate Terraform with CI/CD tools like GitHub Actions or Jenkins by adding steps in your workflow YAML, e.g.:

- name: Terraform Init
  run: terraform init
- name: Terraform Apply
  run: terraform apply -auto-approve

Use remote state backends for collaboration, e.g., configure in main.tf with terraform {backend "s3" {bucket = "my-terraform-state" key = "path/to/state" region = "us-west-2"}}. For secrets, inject via env vars (e.g., $AWS_ACCESS_KEY_ID) or tools like Vault. Ensure provider versions are pinned in.tf files, like terraform {required_providers {aws = {source = "hashicorp/aws" version = "~> 4.0"}}}, to avoid breaking changes.

Error Handling

Handle errors by running terraform validate first to check HCL syntax; fix issues like missing brackets or invalid attributes. For provider errors, verify credentials (e.g., check $AWS_ACCESS_KEY_ID is set) and use terraform plan -detailed-exitcode to get specific codes (e.g., 2 for errors). Common patterns: wrap commands in try-catch blocks in scripts, e.g.:

try {
  terraform apply
} catch {
  echo "Error: Apply failed; check logs for details"
}

Debug with TF_LOG=DEBUG terraform apply to log provider interactions, and use terraform state pull to inspect state files for inconsistencies.

Usage Examples

  1. Create an AWS EC2 instance: Define in main.tf as resource "aws_instance" "web" {ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" tags = {Name = "web-server"}}. Then run terraform init, followed by terraform apply -auto-approve to provision it.
  2. Manage a simple VPC: In main.tf, add resource "aws_vpc" "main" {cidr_block = "10.0.0.0/16"} and resource "aws_subnet" "subnet1" {vpc_id = aws_vpc.main.id cidr_block = "10.0.1.0/24"}. Execute terraform plan to review, then terraform apply for deployment.

Graph Relationships

  • Connected to cluster: devops-sre
  • Related tags: terraform, iac, devops
  • Links to other skills: via devops-sre (e.g., ansible for configuration management), and iac-related tools like pulumi or cloudformation for alternative provisioning methods.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.9%
按下载量换算45

Claude

32.26%
按下载量换算42

Cursor

19.02%
按下载量换算25

Gemini CLI

9.94%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills