terraform
$
npx mdskill add partme-ai/full-stack-skills/terraformGuides Terraform infrastructure as code for multi-cloud provisioning, state management, and best practices.
- Helps users write, debug, and manage Terraform configurations and cloud resources.
- Integrates with AWS, Azure, GCP, and other cloud providers via Terraform providers.
- Recommends actions based on user queries about Terraform workflows and IaC needs.
- Presents guidance through step-by-step instructions and HCL code examples.
SKILL.md
.github/skills/terraformView on GitHub ↗
---
name: terraform
description: "Provides comprehensive guidance for Terraform including infrastructure as code, providers, modules, state management, and multi-cloud resource provisioning. Use when the user asks about Terraform, needs to create IaC configurations, manage cloud resources, or implement Terraform best practices."
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- Write or debug Terraform configuration files (`.tf`)
- Manage cloud infrastructure (AWS, Azure, GCP, etc.)
- Configure providers, resources, data sources, and outputs
- Manage Terraform state, modules, and workspaces
## How to use this skill
### Workflow
1. **Write configuration** — define providers, resources, variables, and outputs in HCL
2. **Initialize** — run `terraform init` to download providers and modules
3. **Plan** — run `terraform plan` to preview changes
4. **Apply** — run `terraform apply` to provision infrastructure
5. **Validate** — confirm resources with `terraform state list` and cloud console
### Quick Start Example
```hcl
# main.tf
terraform {
required_version = ">= 1.5"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "myapp-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-locks"
}
}
provider "aws" {
region = var.aws_region
}
variable "aws_region" {
description = "AWS region for resources"
type = string
default = "us-east-1"
}
resource "aws_s3_bucket" "app_assets" {
bucket = "myapp-${var.environment}-assets"
tags = {
Environment = var.environment
ManagedBy = "terraform"
}
}
output "bucket_arn" {
value = aws_s3_bucket.app_assets.arn
}
```
```bash
# Standard workflow
terraform init
terraform fmt # Format code
terraform validate # Check syntax
terraform plan # Preview changes
terraform apply # Apply changes
# State inspection
terraform state list
terraform state show aws_s3_bucket.app_assets
```
### Module Usage Example
```hcl
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"
name = "myapp-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"]
}
```
## Best Practices
- Use remote state (S3 + DynamoDB, Azure Blob, etc.) to avoid state file conflicts
- Store sensitive values in variables or environment variables — never hardcode in `.tf` files
- Run `terraform fmt` and `terraform validate` before every commit
- Use workspaces or directory-based environments for isolation (dev/staging/prod)
- Version-pin providers and modules to avoid unexpected breaking changes
## Troubleshooting
- **State lock error**: Check for stale locks in DynamoDB/backend; use `terraform force-unlock` as last resort
- **Provider version conflict**: Pin versions in `required_providers` and run `terraform init -upgrade`
- **Drift detected**: Run `terraform plan` to see differences; import or taint resources as needed
- **Destroy hanging**: Check for resource dependencies; use `-target` for selective destruction
## Keywords
terraform, iac, infrastructure as code, hcl, aws, azure, gcp, modules, state management, cloud provisioning
More from partme-ai/full-stack-skills
- adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
- angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
- ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
- ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
- ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
- ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
- ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
- api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
- appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
- ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."