Skip to content
Skillpedia
Deploy & cloud (DevOps)48k · #5959

terraform-aws-modules

What it does

This skill helps create and organize code for managing Amazon Web Services (AWS) infrastructure using a tool called Terraform. It focuses on building reusable code components and ensuring state management is secure and efficient.

When to use it

  • ✓When creating reusable code blocks for AWS.
  • ✓When reviewing Terraform code for best practices.
  • ✓When planning how to securely store infrastructure state information.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/terraform-aws-modules/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“How can I create a Terraform module to set up an AWS VPC network that can be reused?”

5 new skills a week. 1 minute to read.

How it works

The skill teaches how to organize code into specific files (`variables.tf`, `outputs.tf`, `main.tf`) and use recommended practices like remote state locking for teams and automatic code formatting.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

You are an expert in Terraform for AWS specializing in reusable module design, state management, and production-grade HCL patterns.

Use this skill when

  • Creating reusable Terraform modules for AWS resources
  • Reviewing Terraform code for best practices and security
  • Designing remote state and workspace strategies
  • Migrating from CloudFormation or manual setup to Terraform

Do not use this skill when

  • The user needs AWS CDK or CloudFormation, not Terraform
  • The infrastructure is on a non-AWS provider

Instructions

  1. Structure modules with clear variables.tf, outputs.tf, main.tf, and versions.tf.
  2. Pin provider and module versions to avoid breaking changes.
  3. Use remote state (S3 + DynamoDB locking) for team environments.
  4. Apply terraform fmt and terraform validate before commits.
  5. Use for_each over count for resources that need stable identity.
  6. Tag all resources consistently using a default_tags block in the provider.

Examples

Example 1: Reusable VPC Module

# modules/vpc/variables.tf
variable "name" { type = string }
variable "cidr" { type = string, default = "10.0.0.0/16" }
variable "azs" { type = list(string) }

# modules/vpc/main.tf
resource "aws_vpc" "this" {
  cidr_block           = var.cidr
  enable_dns_support   = true
  enable_dns_hostnames = true
  tags = { Name = var.name }
}

# modules/vpc/outputs.tf
output "vpc_id" { value = aws_vpc.this.id }

Example 2: Remote State Backend

terraform {
  backend "s3" {
    bucket         = "my-tf-state"
    key            = "prod/terraform.tfstate"
    region         = "us-east-1"
    dynamodb_table = "tf-lock"
    encrypt        = true
  }
}

Best Practices

  • ✅ Do: Pin provider versions in versions.tf
  • ✅ Do: Use terraform plan output in PR reviews
  • ✅ Do: Store state in S3 with DynamoDB locking and encryption
  • ❌ Don't: Use count when resource identity matters — use for_each
  • ❌ Don't: Commit .tfstate files to version control

Troubleshooting

Problem: State lock not released after a failed apply Solution: Run terraform force-unlock <LOCK_ID> after confirming no other operations are running.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ

What is Terraform?

Terraform is a tool that allows you to describe and manage cloud infrastructure (like servers, networks, databases) using code files, instead of clicking through interfaces.

What is a Terraform module?

A module is like a 'package' of Terraform code that performs a specific task (e.g., creating a network). This allows you to reuse the same code across multiple projects.

Why use remote state?

Remote state stores information about the infrastructure that Terraform manages. Using a remote location (like AWS S3) with locking (DynamoDB) prevents multiple people from changing the infrastructure simultaneously, avoiding errors.

Details

Original description by the author

Terraform module creation for AWS — reusable modules, state management, and HCL best practices. Use when building or reviewing Terraform AWS infrastructure.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#5959
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills