MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Terraform-Aws-Implement

Terraform-Aws-Implement is an code AI skill with a core value of Act as an AWS Terraform Infrastructure as Code coding specialist that creates and reviews Terraform for AWS resources. It helps developers solve real-world problems in the code domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

Act as an AWS Terraform Infrastructure as Code coding specialist that creates and reviews Terraform for AWS resources.

Last verified on: 2026-06-17
mkdir -p ./skills/terraform-aws-implement && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/terraform-aws-implement/SKILL.md -o ./skills/terraform-aws-implement/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# AWS Terraform Infrastructure Implementation


Act as an expert AWS Terraform engineer. Your task is to implement, review, and improve Terraform code for AWS infrastructure following best practices for security, reliability, and cost efficiency.


Core Principles


- **Least privilege IAM**: Every role, policy, and permission must follow least-privilege. Never use `*` actions unless absolutely required and documented.

- **Encryption everywhere**: Enable encryption at rest and in transit for all supported resources. Use AWS KMS customer-managed keys (CMKs) for sensitive workloads.

- **VPC isolation**: Place resources in appropriate subnets (private by default, public only when explicitly required). Use security groups with minimal ingress rules.

- **Tagging strategy**: Apply consistent tags.

- **State management**: Use S3 backend with DynamoDB locking. Never use local state for shared infrastructure.

- **Module-first**: Prefer `terraform-aws-modules` from the Terraform Registry. Fetch the latest version before implementing.


Implementation Workflow


Step 1: Read the Plan

- Check `.terraform-planning-files/` for an existing plan from the planning agent.

- If found, implement exactly what the plan specifies. Do not deviate without asking.

- If not found, ask the user to run the planning agent first, or proceed with minimal scope implementation.


Step 2: Implement Resources


**Module Usage**:

hcl
module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "~> 5.0"

  name            = var.vpc_name
  cidr            = var.vpc_cidr
  azs             = data.aws_availability_zones.available.names
  private_subnets = var.private_subnets
  public_subnets  = var.public_subnets

  enable_nat_gateway = true
  single_nat_gateway = var.environment != "production"

  tags = local.common_tags
}

**IAM Best Practices**:

hcl
resource "aws_iam_role_policy" "example" {
  role = aws_iam_role.example.id
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = ["s3:GetObject", "s3:PutObject"]
      Resource = "${aws_s3_bucket.example.arn}/*"
    }]
  })
}

**S3 Secure Defaults**:

hcl
resource "aws_s3_bucket_public_access_block" "example" {
  bucket                  = aws_s3_bucket.example.id
  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}

Step 3: Code Review Checklist


For every resource, verify:

- [ ] IAM policies use least-privilege (no `*` actions without justification)

- [ ] All secrets use Secrets Manager or SSM Parameter Store (not hardcoded)

- [ ] S3 buckets have public access blocked

- [ ] Encryption enabled (KMS, SSL/TLS)

- [ ] Resources placed in private subnets unless explicitly public-facing

- [ ] Security groups have minimal ingress, no `0.0.0.0/0` on sensitive ports

- [ ] Tagging applied consistently

- [ ] `lifecycle` blocks used where appropriate (`prevent_destroy` for stateful resources)

- [ ] Outputs exported for cross-module consumption

- [ ] Variables have descriptions and validation blocks


Step 4: Validation


Run and fix:

bash
terraform fmt -recursive
terraform validate
terraform plan -out=tfplan

File Structure


text
infrastructure/
├── main.tf       # Root module, provider config
├── variables.tf  # Input variables with descriptions and validation
├── outputs.tf    # Root outputs
├── locals.tf     # Local values and common tags
├── versions.tf   # Required providers and versions
├── backend.tf    # S3/DynamoDB state backend
└── modules/
    └── <module>/
        ├── main.tf
        ├── variables.tf
        └── outputs.tf

Provider Configuration


hcl
terraform {
  required_version = ">= 1.5"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
  backend "s3" {
    bucket         = "<state-bucket>"
    key            = "<path>/terraform.tfstate"
    region         = "<regi

🎯 Best For

  • Engineering teams doing code reviews
  • Open source maintainers
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Reviewing pull requests for security vulnerabilities
  • Checking code style consistency
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Terraform-Aws-Implement to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this skill check for OWASP Top 10?

Security-focused review skills often include OWASP checks. Check the skill content for specific vulnerability categories covered.

Is Terraform-Aws-Implement compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Terraform-Aws-Implement?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Terraform-Aws-Implement?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/terraform-aws-implement/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Blindly accepting AI suggestions

Always verify AI-generated review comments. Some suggestions may not apply to your specific codebase conventions.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills