aws-iac-patterns

Implement secure multi-environment AWS infrastructure patterns with Terraform.

6|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wesleyosantos91/multi-agents --skill aws-iac-patterns
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aws-iac-patterns
Source: https://github.com/wesleyosantos91/multi-agents/tree/main/devin/.devin/skills/aws-iac-patterns
Command: npx skills add https://github.com/wesleyosantos91/multi-agents --skill aws-iac-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of building inconsistent, insecure, and hard-to-maintain AWS infrastructure with Terraform by providing proven multi-environment patterns for state management, least-privilege IAM, monitoring, and secrets handling.

Core Features & Use Cases

  • Multi-environment Terraform structure: Organizes modules/ and environments/ (dev/staging/prod) with a shared global/ layer for IAM and a remote state backend.
  • Secure remote state setup: Uses S3 for Terraform state with encryption (KMS) and DynamoDB for state locking to prevent concurrent writes.
  • Reusable Terraform modules: Encourages composable modules (e.g., Lambda) with clean variables/outputs to speed up consistent infra creation.
  • Least-privilege IAM policies: Provides policy patterns scoped to specific resources (no *) for DynamoDB, SQS, and secrets access.
  • CloudWatch alerting patterns: Defines alarms for critical components like Lambda errors and DynamoDB throttling.
  • Secrets management guidance: Chooses Secrets Manager vs Parameter Store appropriately, includes rotation strategy, and demonstrates runtime access.
  • Mandatory tagging standard: Establishes required tags (environment/service/team/cost center/managed-by) applied across resources.

Quick Start

Ask the AI to generate a Terraform repo layout for dev/staging/prod AWS using the aws-iac-patterns conventions, then produce the S3+DynamoDB remote state config, a reusable Lambda module, and least-privilege IAM for DynamoDB/SQS plus Secrets Manager access.

Frequently Asked Questions about aws-iac-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Terraform for multiple AWS environments?▼

Structure Terraform for multiple AWS environments by organizing directories into `modules/` and `environments/` (dev/staging/prod) alongside a shared `global/` layer for IAM and remote state backend configuration. This approach ensures consistent, repeatable infrastructure deployment across stages.

What is the best way to secure Terraform remote state in S3?▼

Secure Terraform remote state in S3 by enabling KMS encryption on the S3 bucket and configuring a DynamoDB table for state locking. This setup prevents concurrent write operations and protects sensitive infrastructure state data at rest.

How do I create least-privilege IAM policies for Terraform modules?▼

Create least-privilege IAM policies by scoping permissions to specific resource ARNs instead of using wildcards (`*`). This pattern applies granular access controls for DynamoDB, SQS, and Secrets Manager interactions within your Terraform modules.

Should I use AWS Secrets Manager or Parameter Store for runtime secrets?▼

Choose AWS Secrets Manager for automated rotation capabilities and Parameter Store for standard KMS-encrypted configuration values. Your choice depends on whether your runtime secrets require automated rotation strategies or simple encrypted parameter access.

How do I set up CloudWatch alarms for Lambda and DynamoDB in Terraform?▼

Set up CloudWatch alarms for Lambda and DynamoDB by defining Terraform resources that monitor critical metrics like Lambda errors and DynamoDB throttling. These alerting patterns trigger notifications when infrastructure components exceed acceptable operational thresholds.

Does Terraform require mandatory tagging across all AWS resources?▼

Terraform requires mandatory tagging to establish consistent resource metadata across AWS environments. Applying required tags like environment, service, team, cost center, and managed-by ensures standardized resource tracking and cost allocation throughout your infrastructure.