[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-hashicorp-refactor-module":3,"mdc--n3jdta-key":34,"related-repo-hashicorp-refactor-module":4466,"related-org-hashicorp-refactor-module":4560},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":29,"sourceUrl":32,"mdContent":33},"refactor-module","refactor Terraform configurations into reusable modules","Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"hashicorp","HashiCorp","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fhashicorp.png",[12,16,19],{"name":13,"slug":14,"type":15},"Architecture","architecture","tag",{"name":17,"slug":18,"type":15},"Terraform","terraform",{"name":20,"slug":21,"type":15},"Infrastructure as Code","infrastructure-as-code",728,"https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fagent-skills","2026-04-06T18:25:20.953737",null,104,[28],"doormat-managed",{"repoUrl":23,"stars":22,"forks":26,"topics":30,"description":31},[28],"A collection of Agent skills and Claude Code plugins for HashiCorp products.","https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fagent-skills\u002Ftree\u002FHEAD\u002Fterraform\u002Fmodule-generation\u002Fskills\u002Frefactor-module","---\nname: refactor-module\ndescription: Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.\nmetadata:\n  copyright: Copyright IBM Corp. 2026\n  version: \"0.0.1\"\n---\n\n# Skill: Refactor Module\n\n## Overview\nThis skill guides AI agents in transforming monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.\n\n## Capability Statement\nThe agent will analyze existing Terraform code and systematically refactor it into well-structured modules with:\n- Clear interface contracts (variables and outputs)\n- Proper encapsulation and abstraction\n- Versioning and documentation\n- Testing frameworks\n- Migration path for existing state\n\n## Prerequisites\n- Existing Terraform configuration to refactor\n- Understanding of resource dependencies\n- Access to current state file (for migration planning)\n- Knowledge of module registry patterns\n\n## Input Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `source_directory` | string | Yes | Path to existing Terraform configuration |\n| `module_name` | string | Yes | Name for the new module |\n| `abstraction_level` | string | No | \"simple\", \"intermediate\", \"advanced\" (default: intermediate) |\n| `preserve_state` | boolean | Yes | Whether to maintain state compatibility |\n| `target_registry` | string | No | Target module registry (local, private, public) |\n\n## Execution Steps\n\n### 1. Analysis Phase\n```markdown\n**Identify Refactoring Candidates**\n- Group resources by logical function\n- Identify repeated patterns\n- Map resource dependencies\n- Detect configuration coupling\n- Analyze variable usage patterns\n\n**Complexity Assessment**\n- Count resource relationships\n- Measure variable propagation depth\n- Identify cross-resource references\n- Evaluate state migration complexity\n```\n\n### 2. Module Design\n\n#### Interface Design\n```hcl\n# Define clear input contract\nvariable \"network_config\" {\n  description = \"Network configuration parameters\"\n  type = object({\n    cidr_block         = string\n    availability_zones = list(string)\n    enable_nat         = bool\n  })\n\n  validation {\n    condition     = can(cidrhost(var.network_config.cidr_block, 0))\n    error_message = \"CIDR block must be valid IPv4 CIDR.\"\n  }\n}\n\n# Define output contract\noutput \"vpc_id\" {\n  description = \"ID of the created VPC\"\n  value       = aws_vpc.main.id\n}\n\noutput \"private_subnet_ids\" {\n  description = \"List of private subnet IDs\"\n  value       = { for k, v in aws_subnet.private : k => v.id }\n}\n```\n\n#### Encapsulation Strategy\n```markdown\n**What to Include in Module:**\n- Tightly coupled resources (VPC + subnets)\n- Resources with shared lifecycle\n- Configuration with clear boundaries\n\n**What to Keep Separate:**\n- Cross-cutting concerns (monitoring, tagging)\n- Resources with different lifecycles\n- Provider-specific configurations\n```\n\n### 3. Code Transformation\n\n#### Before: Monolithic Configuration\n```hcl\n# main.tf (monolithic)\nresource \"aws_vpc\" \"main\" {\n  cidr_block = \"10.0.0.0\u002F16\"\n  enable_dns_hostnames = true\n\n  tags = {\n    Name = \"production-vpc\"\n    Environment = \"prod\"\n  }\n}\n\nresource \"aws_subnet\" \"public_1\" {\n  vpc_id            = aws_vpc.main.id\n  cidr_block        = \"10.0.1.0\u002F24\"\n  availability_zone = \"us-east-1a\"\n\n  tags = {\n    Name = \"public-subnet-1\"\n    Type = \"public\"\n  }\n}\n\nresource \"aws_subnet\" \"public_2\" {\n  vpc_id            = aws_vpc.main.id\n  cidr_block        = \"10.0.2.0\u002F24\"\n  availability_zone = \"us-east-1b\"\n\n  tags = {\n    Name = \"public-subnet-2\"\n    Type = \"public\"\n  }\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  vpc_id = aws_vpc.main.id\n\n  tags = {\n    Name = \"production-igw\"\n  }\n}\n\n# ... more repetitive subnet and routing resources\n```\n\n#### After: Modular Structure\n```hcl\n# modules\u002Fvpc\u002Fmain.tf\nlocals {\n  subnet_count = length(var.availability_zones)\n}\n\nresource \"aws_vpc\" \"main\" {\n  cidr_block           = var.cidr_block\n  enable_dns_hostnames = var.enable_dns_hostnames\n  enable_dns_support   = var.enable_dns_support\n\n  tags = merge(\n    var.tags,\n    {\n      Name = var.name\n    }\n  )\n}\n\nresource \"aws_subnet\" \"public\" {\n  for_each = var.create_public_subnets ? toset(var.availability_zones) : []\n\n  vpc_id                  = aws_vpc.main.id\n  cidr_block              = cidrsubnet(var.cidr_block, 8, index(var.availability_zones, each.value))\n  availability_zone       = each.value\n  map_public_ip_on_launch = true\n\n  tags = merge(\n    var.tags,\n    {\n      Name = \"${var.name}-public-${each.value}\"\n      Type = \"public\"\n    }\n  )\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  count  = var.create_public_subnets ? 1 : 0\n  vpc_id = aws_vpc.main.id\n\n  tags = merge(\n    var.tags,\n    {\n      Name = \"${var.name}-igw\"\n    }\n  )\n}\n\n# modules\u002Fvpc\u002Fvariables.tf\nvariable \"name\" {\n  description = \"Name prefix for all resources\"\n  type        = string\n}\n\nvariable \"cidr_block\" {\n  description = \"CIDR block for the VPC\"\n  type        = string\n\n  validation {\n    condition     = can(cidrhost(var.cidr_block, 0))\n    error_message = \"Must be a valid IPv4 CIDR block.\"\n  }\n}\n\nvariable \"availability_zones\" {\n  description = \"List of availability zones\"\n  type        = list(string)\n}\n\nvariable \"create_public_subnets\" {\n  description = \"Whether to create public subnets\"\n  type        = bool\n  default     = true\n}\n\nvariable \"enable_dns_hostnames\" {\n  description = \"Enable DNS hostnames in the VPC\"\n  type        = bool\n  default     = true\n}\n\nvariable \"enable_dns_support\" {\n  description = \"Enable DNS support in the VPC\"\n  type        = bool\n  default     = true\n}\n\nvariable \"tags\" {\n  description = \"Tags to apply to all resources\"\n  type        = map(string)\n  default     = {}\n}\n\n# modules\u002Fvpc\u002Foutputs.tf\noutput \"vpc_id\" {\n  description = \"ID of the VPC\"\n  value       = aws_vpc.main.id\n}\n\noutput \"vpc_cidr_block\" {\n  description = \"CIDR block of the VPC\"\n  value       = aws_vpc.main.cidr_block\n}\n\noutput \"public_subnet_ids\" {\n  description = \"Map of availability zones to public subnet IDs\"\n  value       = { for k, v in aws_subnet.public : k => v.id }\n}\n\noutput \"internet_gateway_id\" {\n  description = \"ID of the internet gateway\"\n  value       = try(aws_internet_gateway.main[0].id, null)\n}\n\n# Root configuration using module\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n\n  name               = \"production\"\n  cidr_block         = \"10.0.0.0\u002F16\"\n  availability_zones = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]\n\n  tags = {\n    Environment = \"production\"\n    ManagedBy   = \"Terraform\"\n  }\n}\n```\n\n### 4. State Migration\n\n#### Generate Migration Plan\n```hcl\n# migration.tf\n# Use moved blocks for state refactoring (Terraform 1.1+)\n\nmoved {\n  from = aws_vpc.main\n  to   = module.vpc.aws_vpc.main\n}\n\nmoved {\n  from = aws_subnet.public_1\n  to   = module.vpc.aws_subnet.public[\"us-east-1a\"]\n}\n\nmoved {\n  from = aws_subnet.public_2\n  to   = module.vpc.aws_subnet.public[\"us-east-1b\"]\n}\n\nmoved {\n  from = aws_internet_gateway.main\n  to   = module.vpc.aws_internet_gateway.main[0]\n}\n```\n\n#### Manual State Migration (Pre-1.1)\n```bash\n# Generate state migration commands\nterraform state mv aws_vpc.main module.vpc.aws_vpc.main\nterraform state mv aws_subnet.public_1 'module.vpc.aws_subnet.public[\"us-east-1a\"]'\nterraform state mv aws_subnet.public_2 'module.vpc.aws_subnet.public[\"us-east-1b\"]'\nterraform state mv aws_internet_gateway.main 'module.vpc.aws_internet_gateway.main[0]'\n```\n\n### 5. Module Documentation\n\n```markdown\n# VPC Module\n\n## Overview\nCreates a VPC with configurable public and private subnets across multiple availability zones.\n\n## Features\n- Multi-AZ subnet deployment\n- Optional NAT gateway configuration\n- VPC Flow Logs integration\n- Customizable CIDR allocation\n\n## Usage\n\n\\`\\`\\`hcl\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n\n  name               = \"my-vpc\"\n  cidr_block         = \"10.0.0.0\u002F16\"\n  availability_zones = [\"us-east-1a\", \"us-east-1b\"]\n\n  create_public_subnets  = true\n  create_private_subnets = true\n  enable_nat_gateway     = true\n\n  tags = {\n    Environment = \"production\"\n  }\n}\n\\`\\`\\`\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | >= 1.5.0 |\n| aws | ~> 5.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| name | Name prefix for resources | `string` | n\u002Fa | yes |\n| cidr_block | VPC CIDR block | `string` | n\u002Fa | yes |\n| availability_zones | List of AZs | `list(string)` | n\u002Fa | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| vpc_id | VPC identifier |\n| public_subnet_ids | Map of public subnet IDs |\n| private_subnet_ids | Map of private subnet IDs |\n\n## Examples\n\nSee [examples\u002F](.\u002Fexamples\u002F) directory for complete usage examples.\n```\n\n### 6. Testing\n\nUse skill terraform-test\n\n**Test File**: A `.tftest.hcl` or `.tftest.json` file containing test configuration and run blocks that validate your Terraform configuration.\n\n**Test Block**: Optional configuration block that defines test-wide settings (available since Terraform 1.6.0).\n\n**Run Block**: Defines a single test scenario with optional variables, provider configurations, and assertions. Each test file requires at least one run block.\n\n**Assert Block**: Contains conditions that must evaluate to true for the test to pass. Failed assertions cause the test to fail.\n\n**Mock Provider**: Simulates provider behavior without creating real infrastructure (available since Terraform 1.7.0).\n\n**Test Modes**: Tests run in apply mode (default, creates real infrastructure) or plan mode (validates logic without creating resources).\n\n#### File Structure\n\nTerraform test files use the `.tftest.hcl` or `.tftest.json` extension and are typically organized in a `tests\u002F` directory. Use clear naming conventions to distinguish between unit tests (plan mode) and integration tests (apply mode):\n\n```\nmy-module\u002F\n├── main.tf\n├── variables.tf\n├── outputs.tf\n└── tests\u002F\n    ├── unit_test.tftest.hcl      # Unit test (plan mode)\n    └── integration_test.tftest.hcl  # Integration test (apply mode - creates real resources)\n```\n\n## Refactoring Patterns\n\n### Pattern 1: Resource Grouping\nExtract related resources into cohesive modules:\n- Networking (VPC, Subnets, Route Tables)\n- Compute (ASG, Launch Templates, Load Balancers)\n- Data (RDS, ElastiCache, S3)\n\n### Pattern 2: Configuration Layering\n```hcl\n# Base module with defaults\nmodule \"vpc_base\" {\n  source = \".\u002Fmodules\u002Fvpc-base\"\n  # Minimal required inputs\n}\n\n# Environment-specific wrapper\nmodule \"vpc_prod\" {\n  source = \".\u002Fmodules\u002Fvpc-production\"\n  # Inherits from base, adds prod-specific config\n}\n```\n\n### Pattern 3: Composition\n```hcl\n# Small, focused modules\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n}\n\nmodule \"security_groups\" {\n  source = \".\u002Fmodules\u002Fsecurity-groups\"\n  vpc_id = module.vpc.vpc_id\n}\n\nmodule \"application\" {\n  source     = \".\u002Fmodules\u002Fapplication\"\n  vpc_id     = module.vpc.vpc_id\n  subnet_ids = module.vpc.private_subnet_ids\n  sg_ids     = module.security_groups.app_sg_ids\n}\n```\n\n## Common Pitfalls\n\n### 1. Over-Abstraction\n```hcl\n# ❌ Don't create overly generic modules\nvariable \"resources\" {\n  type = map(map(any))  # Too flexible, hard to validate\n}\n\n# ✅ Do use specific, typed interfaces\nvariable \"database_config\" {\n  type = object({\n    engine         = string\n    instance_class = string\n  })\n}\n```\n\n### 2. Tight Coupling\n```hcl\n# ❌ Don't couple modules through direct references\n# module A\noutput \"instance_id\" { value = aws_instance.app.id }\n\n# module B (in same config)\nresource \"aws_eip\" \"app\" {\n  instance = module.a.instance_id  # Tight coupling\n}\n\n# ✅ Do pass dependencies through root module\nmodule \"compute\" {\n  source = \".\u002Fmodules\u002Fcompute\"\n}\n\nresource \"aws_eip\" \"app\" {\n  instance = module.compute.instance_id\n}\n```\n\n### 3. State Migration Errors\nAlways test migration in non-production first:\n```bash\n# Create plan to verify no changes after migration\nterraform plan -out=migration.tfplan\n\n# Review carefully\nterraform show migration.tfplan\n\n# Apply only if plan shows no changes\nterraform apply migration.tfplan\n```\n\n## Version Control Strategy\n\n```hcl\n# Use semantic versioning for modules\nmodule \"vpc\" {\n  source  = \"git::https:\u002F\u002Fgithub.com\u002Forg\u002Fterraform-modules.git\u002F\u002Fvpc?ref=v1.2.0\"\n  version = \"~> 1.2\"\n}\n\n# Pin to specific versions in production\n# Use version ranges in development\n```\n\n## Success Criteria\n\n- [ ] Module has single, well-defined responsibility\n- [ ] All variables have descriptions and types\n- [ ] Validation rules prevent invalid configurations\n- [ ] Outputs provide sufficient information for consumers\n- [ ] Documentation includes usage examples\n- [ ] Tests verify module behavior\n- [ ] State migration completed without resource recreation\n- [ ] No plan differences after refactoring\n\n## Related Skills\n- [Terraform code generation](https:\u002F\u002Fraw.githubusercontent.com\u002Fhashicorp\u002Fagent-skills\u002Frefs\u002Fheads\u002Fmain\u002Fterraform\u002Fcode-generation\u002Fskills\u002Fterraform-style-guide\u002FSKILL.md) - Style guide for the new Terraform Module\n- [Azure Verified Modules](https:\u002F\u002Fraw.githubusercontent.com\u002Fhashicorp\u002Fagent-skills\u002Frefs\u002Fheads\u002Fmain\u002Fterraform\u002Fcode-generation\u002Fskills\u002Fazure-verified-modules\u002FSKILL.md) - Recommended module specifications for Azure\n\n## Resources\n- [Terraform Module Development](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Flanguage\u002Fmodules\u002Fdevelop)\n- [Module Best Practices](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fcloud-docs\u002Fregistry\u002Fdesign)\n\n## Revision History\n\n| Version | Date | Changes |\n|---------|------|---------|\n| 1.0.0 | 2025-11-07 | Initial skill definition |\n",{"data":35,"body":39},{"name":4,"description":6,"metadata":36},{"copyright":37,"version":38},"Copyright IBM Corp. 2026","0.0.1",{"type":40,"children":41},"root",[42,51,58,64,70,75,105,111,134,140,308,314,321,502,508,515,732,738,856,862,868,1207,1213,2249,2255,2261,2433,2439,2587,2593,3430,3436,3441,3468,3478,3488,3498,3508,3518,3524,3550,3560,3566,3572,3577,3595,3601,3693,3699,3827,3833,3839,3937,3943,4079,4085,4090,4185,4191,4259,4265,4345,4351,4380,4386,4409,4415,4460],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"skill-refactor-module",[48],{"type":49,"value":50},"text","Skill: Refactor Module",{"type":43,"tag":52,"props":53,"children":55},"h2",{"id":54},"overview",[56],{"type":49,"value":57},"Overview",{"type":43,"tag":59,"props":60,"children":61},"p",{},[62],{"type":49,"value":63},"This skill guides AI agents in transforming monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.",{"type":43,"tag":52,"props":65,"children":67},{"id":66},"capability-statement",[68],{"type":49,"value":69},"Capability Statement",{"type":43,"tag":59,"props":71,"children":72},{},[73],{"type":49,"value":74},"The agent will analyze existing Terraform code and systematically refactor it into well-structured modules with:",{"type":43,"tag":76,"props":77,"children":78},"ul",{},[79,85,90,95,100],{"type":43,"tag":80,"props":81,"children":82},"li",{},[83],{"type":49,"value":84},"Clear interface contracts (variables and outputs)",{"type":43,"tag":80,"props":86,"children":87},{},[88],{"type":49,"value":89},"Proper encapsulation and abstraction",{"type":43,"tag":80,"props":91,"children":92},{},[93],{"type":49,"value":94},"Versioning and documentation",{"type":43,"tag":80,"props":96,"children":97},{},[98],{"type":49,"value":99},"Testing frameworks",{"type":43,"tag":80,"props":101,"children":102},{},[103],{"type":49,"value":104},"Migration path for existing state",{"type":43,"tag":52,"props":106,"children":108},{"id":107},"prerequisites",[109],{"type":49,"value":110},"Prerequisites",{"type":43,"tag":76,"props":112,"children":113},{},[114,119,124,129],{"type":43,"tag":80,"props":115,"children":116},{},[117],{"type":49,"value":118},"Existing Terraform configuration to refactor",{"type":43,"tag":80,"props":120,"children":121},{},[122],{"type":49,"value":123},"Understanding of resource dependencies",{"type":43,"tag":80,"props":125,"children":126},{},[127],{"type":49,"value":128},"Access to current state file (for migration planning)",{"type":43,"tag":80,"props":130,"children":131},{},[132],{"type":49,"value":133},"Knowledge of module registry patterns",{"type":43,"tag":52,"props":135,"children":137},{"id":136},"input-parameters",[138],{"type":49,"value":139},"Input Parameters",{"type":43,"tag":141,"props":142,"children":143},"table",{},[144,173],{"type":43,"tag":145,"props":146,"children":147},"thead",{},[148],{"type":43,"tag":149,"props":150,"children":151},"tr",{},[152,158,163,168],{"type":43,"tag":153,"props":154,"children":155},"th",{},[156],{"type":49,"value":157},"Parameter",{"type":43,"tag":153,"props":159,"children":160},{},[161],{"type":49,"value":162},"Type",{"type":43,"tag":153,"props":164,"children":165},{},[166],{"type":49,"value":167},"Required",{"type":43,"tag":153,"props":169,"children":170},{},[171],{"type":49,"value":172},"Description",{"type":43,"tag":174,"props":175,"children":176},"tbody",{},[177,206,231,257,283],{"type":43,"tag":149,"props":178,"children":179},{},[180,191,196,201],{"type":43,"tag":181,"props":182,"children":183},"td",{},[184],{"type":43,"tag":185,"props":186,"children":188},"code",{"className":187},[],[189],{"type":49,"value":190},"source_directory",{"type":43,"tag":181,"props":192,"children":193},{},[194],{"type":49,"value":195},"string",{"type":43,"tag":181,"props":197,"children":198},{},[199],{"type":49,"value":200},"Yes",{"type":43,"tag":181,"props":202,"children":203},{},[204],{"type":49,"value":205},"Path to existing Terraform configuration",{"type":43,"tag":149,"props":207,"children":208},{},[209,218,222,226],{"type":43,"tag":181,"props":210,"children":211},{},[212],{"type":43,"tag":185,"props":213,"children":215},{"className":214},[],[216],{"type":49,"value":217},"module_name",{"type":43,"tag":181,"props":219,"children":220},{},[221],{"type":49,"value":195},{"type":43,"tag":181,"props":223,"children":224},{},[225],{"type":49,"value":200},{"type":43,"tag":181,"props":227,"children":228},{},[229],{"type":49,"value":230},"Name for the new module",{"type":43,"tag":149,"props":232,"children":233},{},[234,243,247,252],{"type":43,"tag":181,"props":235,"children":236},{},[237],{"type":43,"tag":185,"props":238,"children":240},{"className":239},[],[241],{"type":49,"value":242},"abstraction_level",{"type":43,"tag":181,"props":244,"children":245},{},[246],{"type":49,"value":195},{"type":43,"tag":181,"props":248,"children":249},{},[250],{"type":49,"value":251},"No",{"type":43,"tag":181,"props":253,"children":254},{},[255],{"type":49,"value":256},"\"simple\", \"intermediate\", \"advanced\" (default: intermediate)",{"type":43,"tag":149,"props":258,"children":259},{},[260,269,274,278],{"type":43,"tag":181,"props":261,"children":262},{},[263],{"type":43,"tag":185,"props":264,"children":266},{"className":265},[],[267],{"type":49,"value":268},"preserve_state",{"type":43,"tag":181,"props":270,"children":271},{},[272],{"type":49,"value":273},"boolean",{"type":43,"tag":181,"props":275,"children":276},{},[277],{"type":49,"value":200},{"type":43,"tag":181,"props":279,"children":280},{},[281],{"type":49,"value":282},"Whether to maintain state compatibility",{"type":43,"tag":149,"props":284,"children":285},{},[286,295,299,303],{"type":43,"tag":181,"props":287,"children":288},{},[289],{"type":43,"tag":185,"props":290,"children":292},{"className":291},[],[293],{"type":49,"value":294},"target_registry",{"type":43,"tag":181,"props":296,"children":297},{},[298],{"type":49,"value":195},{"type":43,"tag":181,"props":300,"children":301},{},[302],{"type":49,"value":251},{"type":43,"tag":181,"props":304,"children":305},{},[306],{"type":49,"value":307},"Target module registry (local, private, public)",{"type":43,"tag":52,"props":309,"children":311},{"id":310},"execution-steps",[312],{"type":49,"value":313},"Execution Steps",{"type":43,"tag":315,"props":316,"children":318},"h3",{"id":317},"_1-analysis-phase",[319],{"type":49,"value":320},"1. Analysis Phase",{"type":43,"tag":322,"props":323,"children":328},"pre",{"className":324,"code":325,"language":326,"meta":327,"style":327},"language-markdown shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","**Identify Refactoring Candidates**\n- Group resources by logical function\n- Identify repeated patterns\n- Map resource dependencies\n- Detect configuration coupling\n- Analyze variable usage patterns\n\n**Complexity Assessment**\n- Count resource relationships\n- Measure variable propagation depth\n- Identify cross-resource references\n- Evaluate state migration complexity\n","markdown","",[329],{"type":43,"tag":185,"props":330,"children":331},{"__ignoreMap":327},[332,355,371,384,397,410,423,433,450,463,476,489],{"type":43,"tag":333,"props":334,"children":337},"span",{"class":335,"line":336},"line",1,[338,344,350],{"type":43,"tag":333,"props":339,"children":341},{"style":340},"--shiki-light:#39ADB5;--shiki-light-font-weight:bold;--shiki-default:#89DDFF;--shiki-default-font-weight:bold;--shiki-dark:#89DDFF;--shiki-dark-font-weight:bold",[342],{"type":49,"value":343},"**",{"type":43,"tag":333,"props":345,"children":347},{"style":346},"--shiki-light:#E53935;--shiki-light-font-weight:bold;--shiki-default:#F07178;--shiki-default-font-weight:bold;--shiki-dark:#F07178;--shiki-dark-font-weight:bold",[348],{"type":49,"value":349},"Identify Refactoring Candidates",{"type":43,"tag":333,"props":351,"children":352},{"style":340},[353],{"type":49,"value":354},"**\n",{"type":43,"tag":333,"props":356,"children":358},{"class":335,"line":357},2,[359,365],{"type":43,"tag":333,"props":360,"children":362},{"style":361},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[363],{"type":49,"value":364},"-",{"type":43,"tag":333,"props":366,"children":368},{"style":367},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[369],{"type":49,"value":370}," Group resources by logical function\n",{"type":43,"tag":333,"props":372,"children":374},{"class":335,"line":373},3,[375,379],{"type":43,"tag":333,"props":376,"children":377},{"style":361},[378],{"type":49,"value":364},{"type":43,"tag":333,"props":380,"children":381},{"style":367},[382],{"type":49,"value":383}," Identify repeated patterns\n",{"type":43,"tag":333,"props":385,"children":387},{"class":335,"line":386},4,[388,392],{"type":43,"tag":333,"props":389,"children":390},{"style":361},[391],{"type":49,"value":364},{"type":43,"tag":333,"props":393,"children":394},{"style":367},[395],{"type":49,"value":396}," Map resource dependencies\n",{"type":43,"tag":333,"props":398,"children":400},{"class":335,"line":399},5,[401,405],{"type":43,"tag":333,"props":402,"children":403},{"style":361},[404],{"type":49,"value":364},{"type":43,"tag":333,"props":406,"children":407},{"style":367},[408],{"type":49,"value":409}," Detect configuration coupling\n",{"type":43,"tag":333,"props":411,"children":413},{"class":335,"line":412},6,[414,418],{"type":43,"tag":333,"props":415,"children":416},{"style":361},[417],{"type":49,"value":364},{"type":43,"tag":333,"props":419,"children":420},{"style":367},[421],{"type":49,"value":422}," Analyze variable usage patterns\n",{"type":43,"tag":333,"props":424,"children":426},{"class":335,"line":425},7,[427],{"type":43,"tag":333,"props":428,"children":430},{"emptyLinePlaceholder":429},true,[431],{"type":49,"value":432},"\n",{"type":43,"tag":333,"props":434,"children":436},{"class":335,"line":435},8,[437,441,446],{"type":43,"tag":333,"props":438,"children":439},{"style":340},[440],{"type":49,"value":343},{"type":43,"tag":333,"props":442,"children":443},{"style":346},[444],{"type":49,"value":445},"Complexity Assessment",{"type":43,"tag":333,"props":447,"children":448},{"style":340},[449],{"type":49,"value":354},{"type":43,"tag":333,"props":451,"children":453},{"class":335,"line":452},9,[454,458],{"type":43,"tag":333,"props":455,"children":456},{"style":361},[457],{"type":49,"value":364},{"type":43,"tag":333,"props":459,"children":460},{"style":367},[461],{"type":49,"value":462}," Count resource relationships\n",{"type":43,"tag":333,"props":464,"children":466},{"class":335,"line":465},10,[467,471],{"type":43,"tag":333,"props":468,"children":469},{"style":361},[470],{"type":49,"value":364},{"type":43,"tag":333,"props":472,"children":473},{"style":367},[474],{"type":49,"value":475}," Measure variable propagation depth\n",{"type":43,"tag":333,"props":477,"children":479},{"class":335,"line":478},11,[480,484],{"type":43,"tag":333,"props":481,"children":482},{"style":361},[483],{"type":49,"value":364},{"type":43,"tag":333,"props":485,"children":486},{"style":367},[487],{"type":49,"value":488}," Identify cross-resource references\n",{"type":43,"tag":333,"props":490,"children":492},{"class":335,"line":491},12,[493,497],{"type":43,"tag":333,"props":494,"children":495},{"style":361},[496],{"type":49,"value":364},{"type":43,"tag":333,"props":498,"children":499},{"style":367},[500],{"type":49,"value":501}," Evaluate state migration complexity\n",{"type":43,"tag":315,"props":503,"children":505},{"id":504},"_2-module-design",[506],{"type":49,"value":507},"2. Module Design",{"type":43,"tag":509,"props":510,"children":512},"h4",{"id":511},"interface-design",[513],{"type":49,"value":514},"Interface Design",{"type":43,"tag":322,"props":516,"children":520},{"className":517,"code":518,"language":519,"meta":327,"style":327},"language-hcl shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Define clear input contract\nvariable \"network_config\" {\n  description = \"Network configuration parameters\"\n  type = object({\n    cidr_block         = string\n    availability_zones = list(string)\n    enable_nat         = bool\n  })\n\n  validation {\n    condition     = can(cidrhost(var.network_config.cidr_block, 0))\n    error_message = \"CIDR block must be valid IPv4 CIDR.\"\n  }\n}\n\n# Define output contract\noutput \"vpc_id\" {\n  description = \"ID of the created VPC\"\n  value       = aws_vpc.main.id\n}\n\noutput \"private_subnet_ids\" {\n  description = \"List of private subnet IDs\"\n  value       = { for k, v in aws_subnet.private : k => v.id }\n}\n","hcl",[521],{"type":43,"tag":185,"props":522,"children":523},{"__ignoreMap":327},[524,532,540,548,556,564,572,580,588,595,603,611,619,628,637,645,654,663,672,681,689,697,706,715,724],{"type":43,"tag":333,"props":525,"children":526},{"class":335,"line":336},[527],{"type":43,"tag":333,"props":528,"children":529},{},[530],{"type":49,"value":531},"# Define clear input contract\n",{"type":43,"tag":333,"props":533,"children":534},{"class":335,"line":357},[535],{"type":43,"tag":333,"props":536,"children":537},{},[538],{"type":49,"value":539},"variable \"network_config\" {\n",{"type":43,"tag":333,"props":541,"children":542},{"class":335,"line":373},[543],{"type":43,"tag":333,"props":544,"children":545},{},[546],{"type":49,"value":547},"  description = \"Network configuration parameters\"\n",{"type":43,"tag":333,"props":549,"children":550},{"class":335,"line":386},[551],{"type":43,"tag":333,"props":552,"children":553},{},[554],{"type":49,"value":555},"  type = object({\n",{"type":43,"tag":333,"props":557,"children":558},{"class":335,"line":399},[559],{"type":43,"tag":333,"props":560,"children":561},{},[562],{"type":49,"value":563},"    cidr_block         = string\n",{"type":43,"tag":333,"props":565,"children":566},{"class":335,"line":412},[567],{"type":43,"tag":333,"props":568,"children":569},{},[570],{"type":49,"value":571},"    availability_zones = list(string)\n",{"type":43,"tag":333,"props":573,"children":574},{"class":335,"line":425},[575],{"type":43,"tag":333,"props":576,"children":577},{},[578],{"type":49,"value":579},"    enable_nat         = bool\n",{"type":43,"tag":333,"props":581,"children":582},{"class":335,"line":435},[583],{"type":43,"tag":333,"props":584,"children":585},{},[586],{"type":49,"value":587},"  })\n",{"type":43,"tag":333,"props":589,"children":590},{"class":335,"line":452},[591],{"type":43,"tag":333,"props":592,"children":593},{"emptyLinePlaceholder":429},[594],{"type":49,"value":432},{"type":43,"tag":333,"props":596,"children":597},{"class":335,"line":465},[598],{"type":43,"tag":333,"props":599,"children":600},{},[601],{"type":49,"value":602},"  validation {\n",{"type":43,"tag":333,"props":604,"children":605},{"class":335,"line":478},[606],{"type":43,"tag":333,"props":607,"children":608},{},[609],{"type":49,"value":610},"    condition     = can(cidrhost(var.network_config.cidr_block, 0))\n",{"type":43,"tag":333,"props":612,"children":613},{"class":335,"line":491},[614],{"type":43,"tag":333,"props":615,"children":616},{},[617],{"type":49,"value":618},"    error_message = \"CIDR block must be valid IPv4 CIDR.\"\n",{"type":43,"tag":333,"props":620,"children":622},{"class":335,"line":621},13,[623],{"type":43,"tag":333,"props":624,"children":625},{},[626],{"type":49,"value":627},"  }\n",{"type":43,"tag":333,"props":629,"children":631},{"class":335,"line":630},14,[632],{"type":43,"tag":333,"props":633,"children":634},{},[635],{"type":49,"value":636},"}\n",{"type":43,"tag":333,"props":638,"children":640},{"class":335,"line":639},15,[641],{"type":43,"tag":333,"props":642,"children":643},{"emptyLinePlaceholder":429},[644],{"type":49,"value":432},{"type":43,"tag":333,"props":646,"children":648},{"class":335,"line":647},16,[649],{"type":43,"tag":333,"props":650,"children":651},{},[652],{"type":49,"value":653},"# Define output contract\n",{"type":43,"tag":333,"props":655,"children":657},{"class":335,"line":656},17,[658],{"type":43,"tag":333,"props":659,"children":660},{},[661],{"type":49,"value":662},"output \"vpc_id\" {\n",{"type":43,"tag":333,"props":664,"children":666},{"class":335,"line":665},18,[667],{"type":43,"tag":333,"props":668,"children":669},{},[670],{"type":49,"value":671},"  description = \"ID of the created VPC\"\n",{"type":43,"tag":333,"props":673,"children":675},{"class":335,"line":674},19,[676],{"type":43,"tag":333,"props":677,"children":678},{},[679],{"type":49,"value":680},"  value       = aws_vpc.main.id\n",{"type":43,"tag":333,"props":682,"children":684},{"class":335,"line":683},20,[685],{"type":43,"tag":333,"props":686,"children":687},{},[688],{"type":49,"value":636},{"type":43,"tag":333,"props":690,"children":692},{"class":335,"line":691},21,[693],{"type":43,"tag":333,"props":694,"children":695},{"emptyLinePlaceholder":429},[696],{"type":49,"value":432},{"type":43,"tag":333,"props":698,"children":700},{"class":335,"line":699},22,[701],{"type":43,"tag":333,"props":702,"children":703},{},[704],{"type":49,"value":705},"output \"private_subnet_ids\" {\n",{"type":43,"tag":333,"props":707,"children":709},{"class":335,"line":708},23,[710],{"type":43,"tag":333,"props":711,"children":712},{},[713],{"type":49,"value":714},"  description = \"List of private subnet IDs\"\n",{"type":43,"tag":333,"props":716,"children":718},{"class":335,"line":717},24,[719],{"type":43,"tag":333,"props":720,"children":721},{},[722],{"type":49,"value":723},"  value       = { for k, v in aws_subnet.private : k => v.id }\n",{"type":43,"tag":333,"props":725,"children":727},{"class":335,"line":726},25,[728],{"type":43,"tag":333,"props":729,"children":730},{},[731],{"type":49,"value":636},{"type":43,"tag":509,"props":733,"children":735},{"id":734},"encapsulation-strategy",[736],{"type":49,"value":737},"Encapsulation Strategy",{"type":43,"tag":322,"props":739,"children":741},{"className":324,"code":740,"language":326,"meta":327,"style":327},"**What to Include in Module:**\n- Tightly coupled resources (VPC + subnets)\n- Resources with shared lifecycle\n- Configuration with clear boundaries\n\n**What to Keep Separate:**\n- Cross-cutting concerns (monitoring, tagging)\n- Resources with different lifecycles\n- Provider-specific configurations\n",[742],{"type":43,"tag":185,"props":743,"children":744},{"__ignoreMap":327},[745,761,773,785,797,804,820,832,844],{"type":43,"tag":333,"props":746,"children":747},{"class":335,"line":336},[748,752,757],{"type":43,"tag":333,"props":749,"children":750},{"style":340},[751],{"type":49,"value":343},{"type":43,"tag":333,"props":753,"children":754},{"style":346},[755],{"type":49,"value":756},"What to Include in Module:",{"type":43,"tag":333,"props":758,"children":759},{"style":340},[760],{"type":49,"value":354},{"type":43,"tag":333,"props":762,"children":763},{"class":335,"line":357},[764,768],{"type":43,"tag":333,"props":765,"children":766},{"style":361},[767],{"type":49,"value":364},{"type":43,"tag":333,"props":769,"children":770},{"style":367},[771],{"type":49,"value":772}," Tightly coupled resources (VPC + subnets)\n",{"type":43,"tag":333,"props":774,"children":775},{"class":335,"line":373},[776,780],{"type":43,"tag":333,"props":777,"children":778},{"style":361},[779],{"type":49,"value":364},{"type":43,"tag":333,"props":781,"children":782},{"style":367},[783],{"type":49,"value":784}," Resources with shared lifecycle\n",{"type":43,"tag":333,"props":786,"children":787},{"class":335,"line":386},[788,792],{"type":43,"tag":333,"props":789,"children":790},{"style":361},[791],{"type":49,"value":364},{"type":43,"tag":333,"props":793,"children":794},{"style":367},[795],{"type":49,"value":796}," Configuration with clear boundaries\n",{"type":43,"tag":333,"props":798,"children":799},{"class":335,"line":399},[800],{"type":43,"tag":333,"props":801,"children":802},{"emptyLinePlaceholder":429},[803],{"type":49,"value":432},{"type":43,"tag":333,"props":805,"children":806},{"class":335,"line":412},[807,811,816],{"type":43,"tag":333,"props":808,"children":809},{"style":340},[810],{"type":49,"value":343},{"type":43,"tag":333,"props":812,"children":813},{"style":346},[814],{"type":49,"value":815},"What to Keep Separate:",{"type":43,"tag":333,"props":817,"children":818},{"style":340},[819],{"type":49,"value":354},{"type":43,"tag":333,"props":821,"children":822},{"class":335,"line":425},[823,827],{"type":43,"tag":333,"props":824,"children":825},{"style":361},[826],{"type":49,"value":364},{"type":43,"tag":333,"props":828,"children":829},{"style":367},[830],{"type":49,"value":831}," Cross-cutting concerns (monitoring, tagging)\n",{"type":43,"tag":333,"props":833,"children":834},{"class":335,"line":435},[835,839],{"type":43,"tag":333,"props":836,"children":837},{"style":361},[838],{"type":49,"value":364},{"type":43,"tag":333,"props":840,"children":841},{"style":367},[842],{"type":49,"value":843}," Resources with different lifecycles\n",{"type":43,"tag":333,"props":845,"children":846},{"class":335,"line":452},[847,851],{"type":43,"tag":333,"props":848,"children":849},{"style":361},[850],{"type":49,"value":364},{"type":43,"tag":333,"props":852,"children":853},{"style":367},[854],{"type":49,"value":855}," Provider-specific configurations\n",{"type":43,"tag":315,"props":857,"children":859},{"id":858},"_3-code-transformation",[860],{"type":49,"value":861},"3. Code Transformation",{"type":43,"tag":509,"props":863,"children":865},{"id":864},"before-monolithic-configuration",[866],{"type":49,"value":867},"Before: Monolithic Configuration",{"type":43,"tag":322,"props":869,"children":871},{"className":517,"code":870,"language":519,"meta":327,"style":327},"# main.tf (monolithic)\nresource \"aws_vpc\" \"main\" {\n  cidr_block = \"10.0.0.0\u002F16\"\n  enable_dns_hostnames = true\n\n  tags = {\n    Name = \"production-vpc\"\n    Environment = \"prod\"\n  }\n}\n\nresource \"aws_subnet\" \"public_1\" {\n  vpc_id            = aws_vpc.main.id\n  cidr_block        = \"10.0.1.0\u002F24\"\n  availability_zone = \"us-east-1a\"\n\n  tags = {\n    Name = \"public-subnet-1\"\n    Type = \"public\"\n  }\n}\n\nresource \"aws_subnet\" \"public_2\" {\n  vpc_id            = aws_vpc.main.id\n  cidr_block        = \"10.0.2.0\u002F24\"\n  availability_zone = \"us-east-1b\"\n\n  tags = {\n    Name = \"public-subnet-2\"\n    Type = \"public\"\n  }\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  vpc_id = aws_vpc.main.id\n\n  tags = {\n    Name = \"production-igw\"\n  }\n}\n\n# ... more repetitive subnet and routing resources\n",[872],{"type":43,"tag":185,"props":873,"children":874},{"__ignoreMap":327},[875,883,891,899,907,914,922,930,938,945,952,959,967,975,983,991,998,1005,1013,1021,1028,1035,1042,1050,1057,1065,1074,1082,1090,1099,1107,1115,1123,1131,1140,1149,1157,1165,1174,1182,1190,1198],{"type":43,"tag":333,"props":876,"children":877},{"class":335,"line":336},[878],{"type":43,"tag":333,"props":879,"children":880},{},[881],{"type":49,"value":882},"# main.tf (monolithic)\n",{"type":43,"tag":333,"props":884,"children":885},{"class":335,"line":357},[886],{"type":43,"tag":333,"props":887,"children":888},{},[889],{"type":49,"value":890},"resource \"aws_vpc\" \"main\" {\n",{"type":43,"tag":333,"props":892,"children":893},{"class":335,"line":373},[894],{"type":43,"tag":333,"props":895,"children":896},{},[897],{"type":49,"value":898},"  cidr_block = \"10.0.0.0\u002F16\"\n",{"type":43,"tag":333,"props":900,"children":901},{"class":335,"line":386},[902],{"type":43,"tag":333,"props":903,"children":904},{},[905],{"type":49,"value":906},"  enable_dns_hostnames = true\n",{"type":43,"tag":333,"props":908,"children":909},{"class":335,"line":399},[910],{"type":43,"tag":333,"props":911,"children":912},{"emptyLinePlaceholder":429},[913],{"type":49,"value":432},{"type":43,"tag":333,"props":915,"children":916},{"class":335,"line":412},[917],{"type":43,"tag":333,"props":918,"children":919},{},[920],{"type":49,"value":921},"  tags = {\n",{"type":43,"tag":333,"props":923,"children":924},{"class":335,"line":425},[925],{"type":43,"tag":333,"props":926,"children":927},{},[928],{"type":49,"value":929},"    Name = \"production-vpc\"\n",{"type":43,"tag":333,"props":931,"children":932},{"class":335,"line":435},[933],{"type":43,"tag":333,"props":934,"children":935},{},[936],{"type":49,"value":937},"    Environment = \"prod\"\n",{"type":43,"tag":333,"props":939,"children":940},{"class":335,"line":452},[941],{"type":43,"tag":333,"props":942,"children":943},{},[944],{"type":49,"value":627},{"type":43,"tag":333,"props":946,"children":947},{"class":335,"line":465},[948],{"type":43,"tag":333,"props":949,"children":950},{},[951],{"type":49,"value":636},{"type":43,"tag":333,"props":953,"children":954},{"class":335,"line":478},[955],{"type":43,"tag":333,"props":956,"children":957},{"emptyLinePlaceholder":429},[958],{"type":49,"value":432},{"type":43,"tag":333,"props":960,"children":961},{"class":335,"line":491},[962],{"type":43,"tag":333,"props":963,"children":964},{},[965],{"type":49,"value":966},"resource \"aws_subnet\" \"public_1\" {\n",{"type":43,"tag":333,"props":968,"children":969},{"class":335,"line":621},[970],{"type":43,"tag":333,"props":971,"children":972},{},[973],{"type":49,"value":974},"  vpc_id            = aws_vpc.main.id\n",{"type":43,"tag":333,"props":976,"children":977},{"class":335,"line":630},[978],{"type":43,"tag":333,"props":979,"children":980},{},[981],{"type":49,"value":982},"  cidr_block        = \"10.0.1.0\u002F24\"\n",{"type":43,"tag":333,"props":984,"children":985},{"class":335,"line":639},[986],{"type":43,"tag":333,"props":987,"children":988},{},[989],{"type":49,"value":990},"  availability_zone = \"us-east-1a\"\n",{"type":43,"tag":333,"props":992,"children":993},{"class":335,"line":647},[994],{"type":43,"tag":333,"props":995,"children":996},{"emptyLinePlaceholder":429},[997],{"type":49,"value":432},{"type":43,"tag":333,"props":999,"children":1000},{"class":335,"line":656},[1001],{"type":43,"tag":333,"props":1002,"children":1003},{},[1004],{"type":49,"value":921},{"type":43,"tag":333,"props":1006,"children":1007},{"class":335,"line":665},[1008],{"type":43,"tag":333,"props":1009,"children":1010},{},[1011],{"type":49,"value":1012},"    Name = \"public-subnet-1\"\n",{"type":43,"tag":333,"props":1014,"children":1015},{"class":335,"line":674},[1016],{"type":43,"tag":333,"props":1017,"children":1018},{},[1019],{"type":49,"value":1020},"    Type = \"public\"\n",{"type":43,"tag":333,"props":1022,"children":1023},{"class":335,"line":683},[1024],{"type":43,"tag":333,"props":1025,"children":1026},{},[1027],{"type":49,"value":627},{"type":43,"tag":333,"props":1029,"children":1030},{"class":335,"line":691},[1031],{"type":43,"tag":333,"props":1032,"children":1033},{},[1034],{"type":49,"value":636},{"type":43,"tag":333,"props":1036,"children":1037},{"class":335,"line":699},[1038],{"type":43,"tag":333,"props":1039,"children":1040},{"emptyLinePlaceholder":429},[1041],{"type":49,"value":432},{"type":43,"tag":333,"props":1043,"children":1044},{"class":335,"line":708},[1045],{"type":43,"tag":333,"props":1046,"children":1047},{},[1048],{"type":49,"value":1049},"resource \"aws_subnet\" \"public_2\" {\n",{"type":43,"tag":333,"props":1051,"children":1052},{"class":335,"line":717},[1053],{"type":43,"tag":333,"props":1054,"children":1055},{},[1056],{"type":49,"value":974},{"type":43,"tag":333,"props":1058,"children":1059},{"class":335,"line":726},[1060],{"type":43,"tag":333,"props":1061,"children":1062},{},[1063],{"type":49,"value":1064},"  cidr_block        = \"10.0.2.0\u002F24\"\n",{"type":43,"tag":333,"props":1066,"children":1068},{"class":335,"line":1067},26,[1069],{"type":43,"tag":333,"props":1070,"children":1071},{},[1072],{"type":49,"value":1073},"  availability_zone = \"us-east-1b\"\n",{"type":43,"tag":333,"props":1075,"children":1077},{"class":335,"line":1076},27,[1078],{"type":43,"tag":333,"props":1079,"children":1080},{"emptyLinePlaceholder":429},[1081],{"type":49,"value":432},{"type":43,"tag":333,"props":1083,"children":1085},{"class":335,"line":1084},28,[1086],{"type":43,"tag":333,"props":1087,"children":1088},{},[1089],{"type":49,"value":921},{"type":43,"tag":333,"props":1091,"children":1093},{"class":335,"line":1092},29,[1094],{"type":43,"tag":333,"props":1095,"children":1096},{},[1097],{"type":49,"value":1098},"    Name = \"public-subnet-2\"\n",{"type":43,"tag":333,"props":1100,"children":1102},{"class":335,"line":1101},30,[1103],{"type":43,"tag":333,"props":1104,"children":1105},{},[1106],{"type":49,"value":1020},{"type":43,"tag":333,"props":1108,"children":1110},{"class":335,"line":1109},31,[1111],{"type":43,"tag":333,"props":1112,"children":1113},{},[1114],{"type":49,"value":627},{"type":43,"tag":333,"props":1116,"children":1118},{"class":335,"line":1117},32,[1119],{"type":43,"tag":333,"props":1120,"children":1121},{},[1122],{"type":49,"value":636},{"type":43,"tag":333,"props":1124,"children":1126},{"class":335,"line":1125},33,[1127],{"type":43,"tag":333,"props":1128,"children":1129},{"emptyLinePlaceholder":429},[1130],{"type":49,"value":432},{"type":43,"tag":333,"props":1132,"children":1134},{"class":335,"line":1133},34,[1135],{"type":43,"tag":333,"props":1136,"children":1137},{},[1138],{"type":49,"value":1139},"resource \"aws_internet_gateway\" \"main\" {\n",{"type":43,"tag":333,"props":1141,"children":1143},{"class":335,"line":1142},35,[1144],{"type":43,"tag":333,"props":1145,"children":1146},{},[1147],{"type":49,"value":1148},"  vpc_id = aws_vpc.main.id\n",{"type":43,"tag":333,"props":1150,"children":1152},{"class":335,"line":1151},36,[1153],{"type":43,"tag":333,"props":1154,"children":1155},{"emptyLinePlaceholder":429},[1156],{"type":49,"value":432},{"type":43,"tag":333,"props":1158,"children":1160},{"class":335,"line":1159},37,[1161],{"type":43,"tag":333,"props":1162,"children":1163},{},[1164],{"type":49,"value":921},{"type":43,"tag":333,"props":1166,"children":1168},{"class":335,"line":1167},38,[1169],{"type":43,"tag":333,"props":1170,"children":1171},{},[1172],{"type":49,"value":1173},"    Name = \"production-igw\"\n",{"type":43,"tag":333,"props":1175,"children":1177},{"class":335,"line":1176},39,[1178],{"type":43,"tag":333,"props":1179,"children":1180},{},[1181],{"type":49,"value":627},{"type":43,"tag":333,"props":1183,"children":1185},{"class":335,"line":1184},40,[1186],{"type":43,"tag":333,"props":1187,"children":1188},{},[1189],{"type":49,"value":636},{"type":43,"tag":333,"props":1191,"children":1193},{"class":335,"line":1192},41,[1194],{"type":43,"tag":333,"props":1195,"children":1196},{"emptyLinePlaceholder":429},[1197],{"type":49,"value":432},{"type":43,"tag":333,"props":1199,"children":1201},{"class":335,"line":1200},42,[1202],{"type":43,"tag":333,"props":1203,"children":1204},{},[1205],{"type":49,"value":1206},"# ... more repetitive subnet and routing resources\n",{"type":43,"tag":509,"props":1208,"children":1210},{"id":1209},"after-modular-structure",[1211],{"type":49,"value":1212},"After: Modular Structure",{"type":43,"tag":322,"props":1214,"children":1216},{"className":517,"code":1215,"language":519,"meta":327,"style":327},"# modules\u002Fvpc\u002Fmain.tf\nlocals {\n  subnet_count = length(var.availability_zones)\n}\n\nresource \"aws_vpc\" \"main\" {\n  cidr_block           = var.cidr_block\n  enable_dns_hostnames = var.enable_dns_hostnames\n  enable_dns_support   = var.enable_dns_support\n\n  tags = merge(\n    var.tags,\n    {\n      Name = var.name\n    }\n  )\n}\n\nresource \"aws_subnet\" \"public\" {\n  for_each = var.create_public_subnets ? toset(var.availability_zones) : []\n\n  vpc_id                  = aws_vpc.main.id\n  cidr_block              = cidrsubnet(var.cidr_block, 8, index(var.availability_zones, each.value))\n  availability_zone       = each.value\n  map_public_ip_on_launch = true\n\n  tags = merge(\n    var.tags,\n    {\n      Name = \"${var.name}-public-${each.value}\"\n      Type = \"public\"\n    }\n  )\n}\n\nresource \"aws_internet_gateway\" \"main\" {\n  count  = var.create_public_subnets ? 1 : 0\n  vpc_id = aws_vpc.main.id\n\n  tags = merge(\n    var.tags,\n    {\n      Name = \"${var.name}-igw\"\n    }\n  )\n}\n\n# modules\u002Fvpc\u002Fvariables.tf\nvariable \"name\" {\n  description = \"Name prefix for all resources\"\n  type        = string\n}\n\nvariable \"cidr_block\" {\n  description = \"CIDR block for the VPC\"\n  type        = string\n\n  validation {\n    condition     = can(cidrhost(var.cidr_block, 0))\n    error_message = \"Must be a valid IPv4 CIDR block.\"\n  }\n}\n\nvariable \"availability_zones\" {\n  description = \"List of availability zones\"\n  type        = list(string)\n}\n\nvariable \"create_public_subnets\" {\n  description = \"Whether to create public subnets\"\n  type        = bool\n  default     = true\n}\n\nvariable \"enable_dns_hostnames\" {\n  description = \"Enable DNS hostnames in the VPC\"\n  type        = bool\n  default     = true\n}\n\nvariable \"enable_dns_support\" {\n  description = \"Enable DNS support in the VPC\"\n  type        = bool\n  default     = true\n}\n\nvariable \"tags\" {\n  description = \"Tags to apply to all resources\"\n  type        = map(string)\n  default     = {}\n}\n\n# modules\u002Fvpc\u002Foutputs.tf\noutput \"vpc_id\" {\n  description = \"ID of the VPC\"\n  value       = aws_vpc.main.id\n}\n\noutput \"vpc_cidr_block\" {\n  description = \"CIDR block of the VPC\"\n  value       = aws_vpc.main.cidr_block\n}\n\noutput \"public_subnet_ids\" {\n  description = \"Map of availability zones to public subnet IDs\"\n  value       = { for k, v in aws_subnet.public : k => v.id }\n}\n\noutput \"internet_gateway_id\" {\n  description = \"ID of the internet gateway\"\n  value       = try(aws_internet_gateway.main[0].id, null)\n}\n\n# Root configuration using module\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n\n  name               = \"production\"\n  cidr_block         = \"10.0.0.0\u002F16\"\n  availability_zones = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]\n\n  tags = {\n    Environment = \"production\"\n    ManagedBy   = \"Terraform\"\n  }\n}\n",[1217],{"type":43,"tag":185,"props":1218,"children":1219},{"__ignoreMap":327},[1220,1228,1236,1244,1251,1258,1265,1273,1281,1289,1296,1304,1312,1320,1328,1336,1344,1351,1358,1366,1374,1381,1389,1397,1405,1413,1420,1427,1434,1441,1449,1457,1464,1471,1478,1485,1492,1500,1507,1514,1521,1528,1535,1544,1552,1560,1568,1576,1585,1594,1603,1612,1620,1628,1637,1646,1654,1662,1670,1679,1688,1696,1704,1712,1721,1730,1739,1747,1755,1764,1773,1782,1791,1799,1807,1816,1825,1833,1841,1849,1857,1866,1875,1883,1891,1899,1907,1916,1925,1934,1943,1951,1959,1968,1976,1985,1993,2001,2009,2018,2027,2036,2044,2052,2060,2069,2078,2086,2094,2103,2112,2121,2129,2137,2146,2155,2164,2172,2181,2190,2199,2207,2215,2224,2233,2241],{"type":43,"tag":333,"props":1221,"children":1222},{"class":335,"line":336},[1223],{"type":43,"tag":333,"props":1224,"children":1225},{},[1226],{"type":49,"value":1227},"# modules\u002Fvpc\u002Fmain.tf\n",{"type":43,"tag":333,"props":1229,"children":1230},{"class":335,"line":357},[1231],{"type":43,"tag":333,"props":1232,"children":1233},{},[1234],{"type":49,"value":1235},"locals {\n",{"type":43,"tag":333,"props":1237,"children":1238},{"class":335,"line":373},[1239],{"type":43,"tag":333,"props":1240,"children":1241},{},[1242],{"type":49,"value":1243},"  subnet_count = length(var.availability_zones)\n",{"type":43,"tag":333,"props":1245,"children":1246},{"class":335,"line":386},[1247],{"type":43,"tag":333,"props":1248,"children":1249},{},[1250],{"type":49,"value":636},{"type":43,"tag":333,"props":1252,"children":1253},{"class":335,"line":399},[1254],{"type":43,"tag":333,"props":1255,"children":1256},{"emptyLinePlaceholder":429},[1257],{"type":49,"value":432},{"type":43,"tag":333,"props":1259,"children":1260},{"class":335,"line":412},[1261],{"type":43,"tag":333,"props":1262,"children":1263},{},[1264],{"type":49,"value":890},{"type":43,"tag":333,"props":1266,"children":1267},{"class":335,"line":425},[1268],{"type":43,"tag":333,"props":1269,"children":1270},{},[1271],{"type":49,"value":1272},"  cidr_block           = var.cidr_block\n",{"type":43,"tag":333,"props":1274,"children":1275},{"class":335,"line":435},[1276],{"type":43,"tag":333,"props":1277,"children":1278},{},[1279],{"type":49,"value":1280},"  enable_dns_hostnames = var.enable_dns_hostnames\n",{"type":43,"tag":333,"props":1282,"children":1283},{"class":335,"line":452},[1284],{"type":43,"tag":333,"props":1285,"children":1286},{},[1287],{"type":49,"value":1288},"  enable_dns_support   = var.enable_dns_support\n",{"type":43,"tag":333,"props":1290,"children":1291},{"class":335,"line":465},[1292],{"type":43,"tag":333,"props":1293,"children":1294},{"emptyLinePlaceholder":429},[1295],{"type":49,"value":432},{"type":43,"tag":333,"props":1297,"children":1298},{"class":335,"line":478},[1299],{"type":43,"tag":333,"props":1300,"children":1301},{},[1302],{"type":49,"value":1303},"  tags = merge(\n",{"type":43,"tag":333,"props":1305,"children":1306},{"class":335,"line":491},[1307],{"type":43,"tag":333,"props":1308,"children":1309},{},[1310],{"type":49,"value":1311},"    var.tags,\n",{"type":43,"tag":333,"props":1313,"children":1314},{"class":335,"line":621},[1315],{"type":43,"tag":333,"props":1316,"children":1317},{},[1318],{"type":49,"value":1319},"    {\n",{"type":43,"tag":333,"props":1321,"children":1322},{"class":335,"line":630},[1323],{"type":43,"tag":333,"props":1324,"children":1325},{},[1326],{"type":49,"value":1327},"      Name = var.name\n",{"type":43,"tag":333,"props":1329,"children":1330},{"class":335,"line":639},[1331],{"type":43,"tag":333,"props":1332,"children":1333},{},[1334],{"type":49,"value":1335},"    }\n",{"type":43,"tag":333,"props":1337,"children":1338},{"class":335,"line":647},[1339],{"type":43,"tag":333,"props":1340,"children":1341},{},[1342],{"type":49,"value":1343},"  )\n",{"type":43,"tag":333,"props":1345,"children":1346},{"class":335,"line":656},[1347],{"type":43,"tag":333,"props":1348,"children":1349},{},[1350],{"type":49,"value":636},{"type":43,"tag":333,"props":1352,"children":1353},{"class":335,"line":665},[1354],{"type":43,"tag":333,"props":1355,"children":1356},{"emptyLinePlaceholder":429},[1357],{"type":49,"value":432},{"type":43,"tag":333,"props":1359,"children":1360},{"class":335,"line":674},[1361],{"type":43,"tag":333,"props":1362,"children":1363},{},[1364],{"type":49,"value":1365},"resource \"aws_subnet\" \"public\" {\n",{"type":43,"tag":333,"props":1367,"children":1368},{"class":335,"line":683},[1369],{"type":43,"tag":333,"props":1370,"children":1371},{},[1372],{"type":49,"value":1373},"  for_each = var.create_public_subnets ? toset(var.availability_zones) : []\n",{"type":43,"tag":333,"props":1375,"children":1376},{"class":335,"line":691},[1377],{"type":43,"tag":333,"props":1378,"children":1379},{"emptyLinePlaceholder":429},[1380],{"type":49,"value":432},{"type":43,"tag":333,"props":1382,"children":1383},{"class":335,"line":699},[1384],{"type":43,"tag":333,"props":1385,"children":1386},{},[1387],{"type":49,"value":1388},"  vpc_id                  = aws_vpc.main.id\n",{"type":43,"tag":333,"props":1390,"children":1391},{"class":335,"line":708},[1392],{"type":43,"tag":333,"props":1393,"children":1394},{},[1395],{"type":49,"value":1396},"  cidr_block              = cidrsubnet(var.cidr_block, 8, index(var.availability_zones, each.value))\n",{"type":43,"tag":333,"props":1398,"children":1399},{"class":335,"line":717},[1400],{"type":43,"tag":333,"props":1401,"children":1402},{},[1403],{"type":49,"value":1404},"  availability_zone       = each.value\n",{"type":43,"tag":333,"props":1406,"children":1407},{"class":335,"line":726},[1408],{"type":43,"tag":333,"props":1409,"children":1410},{},[1411],{"type":49,"value":1412},"  map_public_ip_on_launch = true\n",{"type":43,"tag":333,"props":1414,"children":1415},{"class":335,"line":1067},[1416],{"type":43,"tag":333,"props":1417,"children":1418},{"emptyLinePlaceholder":429},[1419],{"type":49,"value":432},{"type":43,"tag":333,"props":1421,"children":1422},{"class":335,"line":1076},[1423],{"type":43,"tag":333,"props":1424,"children":1425},{},[1426],{"type":49,"value":1303},{"type":43,"tag":333,"props":1428,"children":1429},{"class":335,"line":1084},[1430],{"type":43,"tag":333,"props":1431,"children":1432},{},[1433],{"type":49,"value":1311},{"type":43,"tag":333,"props":1435,"children":1436},{"class":335,"line":1092},[1437],{"type":43,"tag":333,"props":1438,"children":1439},{},[1440],{"type":49,"value":1319},{"type":43,"tag":333,"props":1442,"children":1443},{"class":335,"line":1101},[1444],{"type":43,"tag":333,"props":1445,"children":1446},{},[1447],{"type":49,"value":1448},"      Name = \"${var.name}-public-${each.value}\"\n",{"type":43,"tag":333,"props":1450,"children":1451},{"class":335,"line":1109},[1452],{"type":43,"tag":333,"props":1453,"children":1454},{},[1455],{"type":49,"value":1456},"      Type = \"public\"\n",{"type":43,"tag":333,"props":1458,"children":1459},{"class":335,"line":1117},[1460],{"type":43,"tag":333,"props":1461,"children":1462},{},[1463],{"type":49,"value":1335},{"type":43,"tag":333,"props":1465,"children":1466},{"class":335,"line":1125},[1467],{"type":43,"tag":333,"props":1468,"children":1469},{},[1470],{"type":49,"value":1343},{"type":43,"tag":333,"props":1472,"children":1473},{"class":335,"line":1133},[1474],{"type":43,"tag":333,"props":1475,"children":1476},{},[1477],{"type":49,"value":636},{"type":43,"tag":333,"props":1479,"children":1480},{"class":335,"line":1142},[1481],{"type":43,"tag":333,"props":1482,"children":1483},{"emptyLinePlaceholder":429},[1484],{"type":49,"value":432},{"type":43,"tag":333,"props":1486,"children":1487},{"class":335,"line":1151},[1488],{"type":43,"tag":333,"props":1489,"children":1490},{},[1491],{"type":49,"value":1139},{"type":43,"tag":333,"props":1493,"children":1494},{"class":335,"line":1159},[1495],{"type":43,"tag":333,"props":1496,"children":1497},{},[1498],{"type":49,"value":1499},"  count  = var.create_public_subnets ? 1 : 0\n",{"type":43,"tag":333,"props":1501,"children":1502},{"class":335,"line":1167},[1503],{"type":43,"tag":333,"props":1504,"children":1505},{},[1506],{"type":49,"value":1148},{"type":43,"tag":333,"props":1508,"children":1509},{"class":335,"line":1176},[1510],{"type":43,"tag":333,"props":1511,"children":1512},{"emptyLinePlaceholder":429},[1513],{"type":49,"value":432},{"type":43,"tag":333,"props":1515,"children":1516},{"class":335,"line":1184},[1517],{"type":43,"tag":333,"props":1518,"children":1519},{},[1520],{"type":49,"value":1303},{"type":43,"tag":333,"props":1522,"children":1523},{"class":335,"line":1192},[1524],{"type":43,"tag":333,"props":1525,"children":1526},{},[1527],{"type":49,"value":1311},{"type":43,"tag":333,"props":1529,"children":1530},{"class":335,"line":1200},[1531],{"type":43,"tag":333,"props":1532,"children":1533},{},[1534],{"type":49,"value":1319},{"type":43,"tag":333,"props":1536,"children":1538},{"class":335,"line":1537},43,[1539],{"type":43,"tag":333,"props":1540,"children":1541},{},[1542],{"type":49,"value":1543},"      Name = \"${var.name}-igw\"\n",{"type":43,"tag":333,"props":1545,"children":1547},{"class":335,"line":1546},44,[1548],{"type":43,"tag":333,"props":1549,"children":1550},{},[1551],{"type":49,"value":1335},{"type":43,"tag":333,"props":1553,"children":1555},{"class":335,"line":1554},45,[1556],{"type":43,"tag":333,"props":1557,"children":1558},{},[1559],{"type":49,"value":1343},{"type":43,"tag":333,"props":1561,"children":1563},{"class":335,"line":1562},46,[1564],{"type":43,"tag":333,"props":1565,"children":1566},{},[1567],{"type":49,"value":636},{"type":43,"tag":333,"props":1569,"children":1571},{"class":335,"line":1570},47,[1572],{"type":43,"tag":333,"props":1573,"children":1574},{"emptyLinePlaceholder":429},[1575],{"type":49,"value":432},{"type":43,"tag":333,"props":1577,"children":1579},{"class":335,"line":1578},48,[1580],{"type":43,"tag":333,"props":1581,"children":1582},{},[1583],{"type":49,"value":1584},"# modules\u002Fvpc\u002Fvariables.tf\n",{"type":43,"tag":333,"props":1586,"children":1588},{"class":335,"line":1587},49,[1589],{"type":43,"tag":333,"props":1590,"children":1591},{},[1592],{"type":49,"value":1593},"variable \"name\" {\n",{"type":43,"tag":333,"props":1595,"children":1597},{"class":335,"line":1596},50,[1598],{"type":43,"tag":333,"props":1599,"children":1600},{},[1601],{"type":49,"value":1602},"  description = \"Name prefix for all resources\"\n",{"type":43,"tag":333,"props":1604,"children":1606},{"class":335,"line":1605},51,[1607],{"type":43,"tag":333,"props":1608,"children":1609},{},[1610],{"type":49,"value":1611},"  type        = string\n",{"type":43,"tag":333,"props":1613,"children":1615},{"class":335,"line":1614},52,[1616],{"type":43,"tag":333,"props":1617,"children":1618},{},[1619],{"type":49,"value":636},{"type":43,"tag":333,"props":1621,"children":1623},{"class":335,"line":1622},53,[1624],{"type":43,"tag":333,"props":1625,"children":1626},{"emptyLinePlaceholder":429},[1627],{"type":49,"value":432},{"type":43,"tag":333,"props":1629,"children":1631},{"class":335,"line":1630},54,[1632],{"type":43,"tag":333,"props":1633,"children":1634},{},[1635],{"type":49,"value":1636},"variable \"cidr_block\" {\n",{"type":43,"tag":333,"props":1638,"children":1640},{"class":335,"line":1639},55,[1641],{"type":43,"tag":333,"props":1642,"children":1643},{},[1644],{"type":49,"value":1645},"  description = \"CIDR block for the VPC\"\n",{"type":43,"tag":333,"props":1647,"children":1649},{"class":335,"line":1648},56,[1650],{"type":43,"tag":333,"props":1651,"children":1652},{},[1653],{"type":49,"value":1611},{"type":43,"tag":333,"props":1655,"children":1657},{"class":335,"line":1656},57,[1658],{"type":43,"tag":333,"props":1659,"children":1660},{"emptyLinePlaceholder":429},[1661],{"type":49,"value":432},{"type":43,"tag":333,"props":1663,"children":1665},{"class":335,"line":1664},58,[1666],{"type":43,"tag":333,"props":1667,"children":1668},{},[1669],{"type":49,"value":602},{"type":43,"tag":333,"props":1671,"children":1673},{"class":335,"line":1672},59,[1674],{"type":43,"tag":333,"props":1675,"children":1676},{},[1677],{"type":49,"value":1678},"    condition     = can(cidrhost(var.cidr_block, 0))\n",{"type":43,"tag":333,"props":1680,"children":1682},{"class":335,"line":1681},60,[1683],{"type":43,"tag":333,"props":1684,"children":1685},{},[1686],{"type":49,"value":1687},"    error_message = \"Must be a valid IPv4 CIDR block.\"\n",{"type":43,"tag":333,"props":1689,"children":1691},{"class":335,"line":1690},61,[1692],{"type":43,"tag":333,"props":1693,"children":1694},{},[1695],{"type":49,"value":627},{"type":43,"tag":333,"props":1697,"children":1699},{"class":335,"line":1698},62,[1700],{"type":43,"tag":333,"props":1701,"children":1702},{},[1703],{"type":49,"value":636},{"type":43,"tag":333,"props":1705,"children":1707},{"class":335,"line":1706},63,[1708],{"type":43,"tag":333,"props":1709,"children":1710},{"emptyLinePlaceholder":429},[1711],{"type":49,"value":432},{"type":43,"tag":333,"props":1713,"children":1715},{"class":335,"line":1714},64,[1716],{"type":43,"tag":333,"props":1717,"children":1718},{},[1719],{"type":49,"value":1720},"variable \"availability_zones\" {\n",{"type":43,"tag":333,"props":1722,"children":1724},{"class":335,"line":1723},65,[1725],{"type":43,"tag":333,"props":1726,"children":1727},{},[1728],{"type":49,"value":1729},"  description = \"List of availability zones\"\n",{"type":43,"tag":333,"props":1731,"children":1733},{"class":335,"line":1732},66,[1734],{"type":43,"tag":333,"props":1735,"children":1736},{},[1737],{"type":49,"value":1738},"  type        = list(string)\n",{"type":43,"tag":333,"props":1740,"children":1742},{"class":335,"line":1741},67,[1743],{"type":43,"tag":333,"props":1744,"children":1745},{},[1746],{"type":49,"value":636},{"type":43,"tag":333,"props":1748,"children":1750},{"class":335,"line":1749},68,[1751],{"type":43,"tag":333,"props":1752,"children":1753},{"emptyLinePlaceholder":429},[1754],{"type":49,"value":432},{"type":43,"tag":333,"props":1756,"children":1758},{"class":335,"line":1757},69,[1759],{"type":43,"tag":333,"props":1760,"children":1761},{},[1762],{"type":49,"value":1763},"variable \"create_public_subnets\" {\n",{"type":43,"tag":333,"props":1765,"children":1767},{"class":335,"line":1766},70,[1768],{"type":43,"tag":333,"props":1769,"children":1770},{},[1771],{"type":49,"value":1772},"  description = \"Whether to create public subnets\"\n",{"type":43,"tag":333,"props":1774,"children":1776},{"class":335,"line":1775},71,[1777],{"type":43,"tag":333,"props":1778,"children":1779},{},[1780],{"type":49,"value":1781},"  type        = bool\n",{"type":43,"tag":333,"props":1783,"children":1785},{"class":335,"line":1784},72,[1786],{"type":43,"tag":333,"props":1787,"children":1788},{},[1789],{"type":49,"value":1790},"  default     = true\n",{"type":43,"tag":333,"props":1792,"children":1794},{"class":335,"line":1793},73,[1795],{"type":43,"tag":333,"props":1796,"children":1797},{},[1798],{"type":49,"value":636},{"type":43,"tag":333,"props":1800,"children":1802},{"class":335,"line":1801},74,[1803],{"type":43,"tag":333,"props":1804,"children":1805},{"emptyLinePlaceholder":429},[1806],{"type":49,"value":432},{"type":43,"tag":333,"props":1808,"children":1810},{"class":335,"line":1809},75,[1811],{"type":43,"tag":333,"props":1812,"children":1813},{},[1814],{"type":49,"value":1815},"variable \"enable_dns_hostnames\" {\n",{"type":43,"tag":333,"props":1817,"children":1819},{"class":335,"line":1818},76,[1820],{"type":43,"tag":333,"props":1821,"children":1822},{},[1823],{"type":49,"value":1824},"  description = \"Enable DNS hostnames in the VPC\"\n",{"type":43,"tag":333,"props":1826,"children":1828},{"class":335,"line":1827},77,[1829],{"type":43,"tag":333,"props":1830,"children":1831},{},[1832],{"type":49,"value":1781},{"type":43,"tag":333,"props":1834,"children":1836},{"class":335,"line":1835},78,[1837],{"type":43,"tag":333,"props":1838,"children":1839},{},[1840],{"type":49,"value":1790},{"type":43,"tag":333,"props":1842,"children":1844},{"class":335,"line":1843},79,[1845],{"type":43,"tag":333,"props":1846,"children":1847},{},[1848],{"type":49,"value":636},{"type":43,"tag":333,"props":1850,"children":1852},{"class":335,"line":1851},80,[1853],{"type":43,"tag":333,"props":1854,"children":1855},{"emptyLinePlaceholder":429},[1856],{"type":49,"value":432},{"type":43,"tag":333,"props":1858,"children":1860},{"class":335,"line":1859},81,[1861],{"type":43,"tag":333,"props":1862,"children":1863},{},[1864],{"type":49,"value":1865},"variable \"enable_dns_support\" {\n",{"type":43,"tag":333,"props":1867,"children":1869},{"class":335,"line":1868},82,[1870],{"type":43,"tag":333,"props":1871,"children":1872},{},[1873],{"type":49,"value":1874},"  description = \"Enable DNS support in the VPC\"\n",{"type":43,"tag":333,"props":1876,"children":1878},{"class":335,"line":1877},83,[1879],{"type":43,"tag":333,"props":1880,"children":1881},{},[1882],{"type":49,"value":1781},{"type":43,"tag":333,"props":1884,"children":1886},{"class":335,"line":1885},84,[1887],{"type":43,"tag":333,"props":1888,"children":1889},{},[1890],{"type":49,"value":1790},{"type":43,"tag":333,"props":1892,"children":1894},{"class":335,"line":1893},85,[1895],{"type":43,"tag":333,"props":1896,"children":1897},{},[1898],{"type":49,"value":636},{"type":43,"tag":333,"props":1900,"children":1902},{"class":335,"line":1901},86,[1903],{"type":43,"tag":333,"props":1904,"children":1905},{"emptyLinePlaceholder":429},[1906],{"type":49,"value":432},{"type":43,"tag":333,"props":1908,"children":1910},{"class":335,"line":1909},87,[1911],{"type":43,"tag":333,"props":1912,"children":1913},{},[1914],{"type":49,"value":1915},"variable \"tags\" {\n",{"type":43,"tag":333,"props":1917,"children":1919},{"class":335,"line":1918},88,[1920],{"type":43,"tag":333,"props":1921,"children":1922},{},[1923],{"type":49,"value":1924},"  description = \"Tags to apply to all resources\"\n",{"type":43,"tag":333,"props":1926,"children":1928},{"class":335,"line":1927},89,[1929],{"type":43,"tag":333,"props":1930,"children":1931},{},[1932],{"type":49,"value":1933},"  type        = map(string)\n",{"type":43,"tag":333,"props":1935,"children":1937},{"class":335,"line":1936},90,[1938],{"type":43,"tag":333,"props":1939,"children":1940},{},[1941],{"type":49,"value":1942},"  default     = {}\n",{"type":43,"tag":333,"props":1944,"children":1946},{"class":335,"line":1945},91,[1947],{"type":43,"tag":333,"props":1948,"children":1949},{},[1950],{"type":49,"value":636},{"type":43,"tag":333,"props":1952,"children":1954},{"class":335,"line":1953},92,[1955],{"type":43,"tag":333,"props":1956,"children":1957},{"emptyLinePlaceholder":429},[1958],{"type":49,"value":432},{"type":43,"tag":333,"props":1960,"children":1962},{"class":335,"line":1961},93,[1963],{"type":43,"tag":333,"props":1964,"children":1965},{},[1966],{"type":49,"value":1967},"# modules\u002Fvpc\u002Foutputs.tf\n",{"type":43,"tag":333,"props":1969,"children":1971},{"class":335,"line":1970},94,[1972],{"type":43,"tag":333,"props":1973,"children":1974},{},[1975],{"type":49,"value":662},{"type":43,"tag":333,"props":1977,"children":1979},{"class":335,"line":1978},95,[1980],{"type":43,"tag":333,"props":1981,"children":1982},{},[1983],{"type":49,"value":1984},"  description = \"ID of the VPC\"\n",{"type":43,"tag":333,"props":1986,"children":1988},{"class":335,"line":1987},96,[1989],{"type":43,"tag":333,"props":1990,"children":1991},{},[1992],{"type":49,"value":680},{"type":43,"tag":333,"props":1994,"children":1996},{"class":335,"line":1995},97,[1997],{"type":43,"tag":333,"props":1998,"children":1999},{},[2000],{"type":49,"value":636},{"type":43,"tag":333,"props":2002,"children":2004},{"class":335,"line":2003},98,[2005],{"type":43,"tag":333,"props":2006,"children":2007},{"emptyLinePlaceholder":429},[2008],{"type":49,"value":432},{"type":43,"tag":333,"props":2010,"children":2012},{"class":335,"line":2011},99,[2013],{"type":43,"tag":333,"props":2014,"children":2015},{},[2016],{"type":49,"value":2017},"output \"vpc_cidr_block\" {\n",{"type":43,"tag":333,"props":2019,"children":2021},{"class":335,"line":2020},100,[2022],{"type":43,"tag":333,"props":2023,"children":2024},{},[2025],{"type":49,"value":2026},"  description = \"CIDR block of the VPC\"\n",{"type":43,"tag":333,"props":2028,"children":2030},{"class":335,"line":2029},101,[2031],{"type":43,"tag":333,"props":2032,"children":2033},{},[2034],{"type":49,"value":2035},"  value       = aws_vpc.main.cidr_block\n",{"type":43,"tag":333,"props":2037,"children":2039},{"class":335,"line":2038},102,[2040],{"type":43,"tag":333,"props":2041,"children":2042},{},[2043],{"type":49,"value":636},{"type":43,"tag":333,"props":2045,"children":2047},{"class":335,"line":2046},103,[2048],{"type":43,"tag":333,"props":2049,"children":2050},{"emptyLinePlaceholder":429},[2051],{"type":49,"value":432},{"type":43,"tag":333,"props":2053,"children":2054},{"class":335,"line":26},[2055],{"type":43,"tag":333,"props":2056,"children":2057},{},[2058],{"type":49,"value":2059},"output \"public_subnet_ids\" {\n",{"type":43,"tag":333,"props":2061,"children":2063},{"class":335,"line":2062},105,[2064],{"type":43,"tag":333,"props":2065,"children":2066},{},[2067],{"type":49,"value":2068},"  description = \"Map of availability zones to public subnet IDs\"\n",{"type":43,"tag":333,"props":2070,"children":2072},{"class":335,"line":2071},106,[2073],{"type":43,"tag":333,"props":2074,"children":2075},{},[2076],{"type":49,"value":2077},"  value       = { for k, v in aws_subnet.public : k => v.id }\n",{"type":43,"tag":333,"props":2079,"children":2081},{"class":335,"line":2080},107,[2082],{"type":43,"tag":333,"props":2083,"children":2084},{},[2085],{"type":49,"value":636},{"type":43,"tag":333,"props":2087,"children":2089},{"class":335,"line":2088},108,[2090],{"type":43,"tag":333,"props":2091,"children":2092},{"emptyLinePlaceholder":429},[2093],{"type":49,"value":432},{"type":43,"tag":333,"props":2095,"children":2097},{"class":335,"line":2096},109,[2098],{"type":43,"tag":333,"props":2099,"children":2100},{},[2101],{"type":49,"value":2102},"output \"internet_gateway_id\" {\n",{"type":43,"tag":333,"props":2104,"children":2106},{"class":335,"line":2105},110,[2107],{"type":43,"tag":333,"props":2108,"children":2109},{},[2110],{"type":49,"value":2111},"  description = \"ID of the internet gateway\"\n",{"type":43,"tag":333,"props":2113,"children":2115},{"class":335,"line":2114},111,[2116],{"type":43,"tag":333,"props":2117,"children":2118},{},[2119],{"type":49,"value":2120},"  value       = try(aws_internet_gateway.main[0].id, null)\n",{"type":43,"tag":333,"props":2122,"children":2124},{"class":335,"line":2123},112,[2125],{"type":43,"tag":333,"props":2126,"children":2127},{},[2128],{"type":49,"value":636},{"type":43,"tag":333,"props":2130,"children":2132},{"class":335,"line":2131},113,[2133],{"type":43,"tag":333,"props":2134,"children":2135},{"emptyLinePlaceholder":429},[2136],{"type":49,"value":432},{"type":43,"tag":333,"props":2138,"children":2140},{"class":335,"line":2139},114,[2141],{"type":43,"tag":333,"props":2142,"children":2143},{},[2144],{"type":49,"value":2145},"# Root configuration using module\n",{"type":43,"tag":333,"props":2147,"children":2149},{"class":335,"line":2148},115,[2150],{"type":43,"tag":333,"props":2151,"children":2152},{},[2153],{"type":49,"value":2154},"module \"vpc\" {\n",{"type":43,"tag":333,"props":2156,"children":2158},{"class":335,"line":2157},116,[2159],{"type":43,"tag":333,"props":2160,"children":2161},{},[2162],{"type":49,"value":2163},"  source = \".\u002Fmodules\u002Fvpc\"\n",{"type":43,"tag":333,"props":2165,"children":2167},{"class":335,"line":2166},117,[2168],{"type":43,"tag":333,"props":2169,"children":2170},{"emptyLinePlaceholder":429},[2171],{"type":49,"value":432},{"type":43,"tag":333,"props":2173,"children":2175},{"class":335,"line":2174},118,[2176],{"type":43,"tag":333,"props":2177,"children":2178},{},[2179],{"type":49,"value":2180},"  name               = \"production\"\n",{"type":43,"tag":333,"props":2182,"children":2184},{"class":335,"line":2183},119,[2185],{"type":43,"tag":333,"props":2186,"children":2187},{},[2188],{"type":49,"value":2189},"  cidr_block         = \"10.0.0.0\u002F16\"\n",{"type":43,"tag":333,"props":2191,"children":2193},{"class":335,"line":2192},120,[2194],{"type":43,"tag":333,"props":2195,"children":2196},{},[2197],{"type":49,"value":2198},"  availability_zones = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]\n",{"type":43,"tag":333,"props":2200,"children":2202},{"class":335,"line":2201},121,[2203],{"type":43,"tag":333,"props":2204,"children":2205},{"emptyLinePlaceholder":429},[2206],{"type":49,"value":432},{"type":43,"tag":333,"props":2208,"children":2210},{"class":335,"line":2209},122,[2211],{"type":43,"tag":333,"props":2212,"children":2213},{},[2214],{"type":49,"value":921},{"type":43,"tag":333,"props":2216,"children":2218},{"class":335,"line":2217},123,[2219],{"type":43,"tag":333,"props":2220,"children":2221},{},[2222],{"type":49,"value":2223},"    Environment = \"production\"\n",{"type":43,"tag":333,"props":2225,"children":2227},{"class":335,"line":2226},124,[2228],{"type":43,"tag":333,"props":2229,"children":2230},{},[2231],{"type":49,"value":2232},"    ManagedBy   = \"Terraform\"\n",{"type":43,"tag":333,"props":2234,"children":2236},{"class":335,"line":2235},125,[2237],{"type":43,"tag":333,"props":2238,"children":2239},{},[2240],{"type":49,"value":627},{"type":43,"tag":333,"props":2242,"children":2244},{"class":335,"line":2243},126,[2245],{"type":43,"tag":333,"props":2246,"children":2247},{},[2248],{"type":49,"value":636},{"type":43,"tag":315,"props":2250,"children":2252},{"id":2251},"_4-state-migration",[2253],{"type":49,"value":2254},"4. State Migration",{"type":43,"tag":509,"props":2256,"children":2258},{"id":2257},"generate-migration-plan",[2259],{"type":49,"value":2260},"Generate Migration Plan",{"type":43,"tag":322,"props":2262,"children":2264},{"className":517,"code":2263,"language":519,"meta":327,"style":327},"# migration.tf\n# Use moved blocks for state refactoring (Terraform 1.1+)\n\nmoved {\n  from = aws_vpc.main\n  to   = module.vpc.aws_vpc.main\n}\n\nmoved {\n  from = aws_subnet.public_1\n  to   = module.vpc.aws_subnet.public[\"us-east-1a\"]\n}\n\nmoved {\n  from = aws_subnet.public_2\n  to   = module.vpc.aws_subnet.public[\"us-east-1b\"]\n}\n\nmoved {\n  from = aws_internet_gateway.main\n  to   = module.vpc.aws_internet_gateway.main[0]\n}\n",[2265],{"type":43,"tag":185,"props":2266,"children":2267},{"__ignoreMap":327},[2268,2276,2284,2291,2299,2307,2315,2322,2329,2336,2344,2352,2359,2366,2373,2381,2389,2396,2403,2410,2418,2426],{"type":43,"tag":333,"props":2269,"children":2270},{"class":335,"line":336},[2271],{"type":43,"tag":333,"props":2272,"children":2273},{},[2274],{"type":49,"value":2275},"# migration.tf\n",{"type":43,"tag":333,"props":2277,"children":2278},{"class":335,"line":357},[2279],{"type":43,"tag":333,"props":2280,"children":2281},{},[2282],{"type":49,"value":2283},"# Use moved blocks for state refactoring (Terraform 1.1+)\n",{"type":43,"tag":333,"props":2285,"children":2286},{"class":335,"line":373},[2287],{"type":43,"tag":333,"props":2288,"children":2289},{"emptyLinePlaceholder":429},[2290],{"type":49,"value":432},{"type":43,"tag":333,"props":2292,"children":2293},{"class":335,"line":386},[2294],{"type":43,"tag":333,"props":2295,"children":2296},{},[2297],{"type":49,"value":2298},"moved {\n",{"type":43,"tag":333,"props":2300,"children":2301},{"class":335,"line":399},[2302],{"type":43,"tag":333,"props":2303,"children":2304},{},[2305],{"type":49,"value":2306},"  from = aws_vpc.main\n",{"type":43,"tag":333,"props":2308,"children":2309},{"class":335,"line":412},[2310],{"type":43,"tag":333,"props":2311,"children":2312},{},[2313],{"type":49,"value":2314},"  to   = module.vpc.aws_vpc.main\n",{"type":43,"tag":333,"props":2316,"children":2317},{"class":335,"line":425},[2318],{"type":43,"tag":333,"props":2319,"children":2320},{},[2321],{"type":49,"value":636},{"type":43,"tag":333,"props":2323,"children":2324},{"class":335,"line":435},[2325],{"type":43,"tag":333,"props":2326,"children":2327},{"emptyLinePlaceholder":429},[2328],{"type":49,"value":432},{"type":43,"tag":333,"props":2330,"children":2331},{"class":335,"line":452},[2332],{"type":43,"tag":333,"props":2333,"children":2334},{},[2335],{"type":49,"value":2298},{"type":43,"tag":333,"props":2337,"children":2338},{"class":335,"line":465},[2339],{"type":43,"tag":333,"props":2340,"children":2341},{},[2342],{"type":49,"value":2343},"  from = aws_subnet.public_1\n",{"type":43,"tag":333,"props":2345,"children":2346},{"class":335,"line":478},[2347],{"type":43,"tag":333,"props":2348,"children":2349},{},[2350],{"type":49,"value":2351},"  to   = module.vpc.aws_subnet.public[\"us-east-1a\"]\n",{"type":43,"tag":333,"props":2353,"children":2354},{"class":335,"line":491},[2355],{"type":43,"tag":333,"props":2356,"children":2357},{},[2358],{"type":49,"value":636},{"type":43,"tag":333,"props":2360,"children":2361},{"class":335,"line":621},[2362],{"type":43,"tag":333,"props":2363,"children":2364},{"emptyLinePlaceholder":429},[2365],{"type":49,"value":432},{"type":43,"tag":333,"props":2367,"children":2368},{"class":335,"line":630},[2369],{"type":43,"tag":333,"props":2370,"children":2371},{},[2372],{"type":49,"value":2298},{"type":43,"tag":333,"props":2374,"children":2375},{"class":335,"line":639},[2376],{"type":43,"tag":333,"props":2377,"children":2378},{},[2379],{"type":49,"value":2380},"  from = aws_subnet.public_2\n",{"type":43,"tag":333,"props":2382,"children":2383},{"class":335,"line":647},[2384],{"type":43,"tag":333,"props":2385,"children":2386},{},[2387],{"type":49,"value":2388},"  to   = module.vpc.aws_subnet.public[\"us-east-1b\"]\n",{"type":43,"tag":333,"props":2390,"children":2391},{"class":335,"line":656},[2392],{"type":43,"tag":333,"props":2393,"children":2394},{},[2395],{"type":49,"value":636},{"type":43,"tag":333,"props":2397,"children":2398},{"class":335,"line":665},[2399],{"type":43,"tag":333,"props":2400,"children":2401},{"emptyLinePlaceholder":429},[2402],{"type":49,"value":432},{"type":43,"tag":333,"props":2404,"children":2405},{"class":335,"line":674},[2406],{"type":43,"tag":333,"props":2407,"children":2408},{},[2409],{"type":49,"value":2298},{"type":43,"tag":333,"props":2411,"children":2412},{"class":335,"line":683},[2413],{"type":43,"tag":333,"props":2414,"children":2415},{},[2416],{"type":49,"value":2417},"  from = aws_internet_gateway.main\n",{"type":43,"tag":333,"props":2419,"children":2420},{"class":335,"line":691},[2421],{"type":43,"tag":333,"props":2422,"children":2423},{},[2424],{"type":49,"value":2425},"  to   = module.vpc.aws_internet_gateway.main[0]\n",{"type":43,"tag":333,"props":2427,"children":2428},{"class":335,"line":699},[2429],{"type":43,"tag":333,"props":2430,"children":2431},{},[2432],{"type":49,"value":636},{"type":43,"tag":509,"props":2434,"children":2436},{"id":2435},"manual-state-migration-pre-11",[2437],{"type":49,"value":2438},"Manual State Migration (Pre-1.1)",{"type":43,"tag":322,"props":2440,"children":2444},{"className":2441,"code":2442,"language":2443,"meta":327,"style":327},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Generate state migration commands\nterraform state mv aws_vpc.main module.vpc.aws_vpc.main\nterraform state mv aws_subnet.public_1 'module.vpc.aws_subnet.public[\"us-east-1a\"]'\nterraform state mv aws_subnet.public_2 'module.vpc.aws_subnet.public[\"us-east-1b\"]'\nterraform state mv aws_internet_gateway.main 'module.vpc.aws_internet_gateway.main[0]'\n","bash",[2445],{"type":43,"tag":185,"props":2446,"children":2447},{"__ignoreMap":327},[2448,2457,2486,2521,2554],{"type":43,"tag":333,"props":2449,"children":2450},{"class":335,"line":336},[2451],{"type":43,"tag":333,"props":2452,"children":2454},{"style":2453},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2455],{"type":49,"value":2456},"# Generate state migration commands\n",{"type":43,"tag":333,"props":2458,"children":2459},{"class":335,"line":357},[2460,2465,2471,2476,2481],{"type":43,"tag":333,"props":2461,"children":2463},{"style":2462},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2464],{"type":49,"value":18},{"type":43,"tag":333,"props":2466,"children":2468},{"style":2467},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[2469],{"type":49,"value":2470}," state",{"type":43,"tag":333,"props":2472,"children":2473},{"style":2467},[2474],{"type":49,"value":2475}," mv",{"type":43,"tag":333,"props":2477,"children":2478},{"style":2467},[2479],{"type":49,"value":2480}," aws_vpc.main",{"type":43,"tag":333,"props":2482,"children":2483},{"style":2467},[2484],{"type":49,"value":2485}," module.vpc.aws_vpc.main\n",{"type":43,"tag":333,"props":2487,"children":2488},{"class":335,"line":373},[2489,2493,2497,2501,2506,2511,2516],{"type":43,"tag":333,"props":2490,"children":2491},{"style":2462},[2492],{"type":49,"value":18},{"type":43,"tag":333,"props":2494,"children":2495},{"style":2467},[2496],{"type":49,"value":2470},{"type":43,"tag":333,"props":2498,"children":2499},{"style":2467},[2500],{"type":49,"value":2475},{"type":43,"tag":333,"props":2502,"children":2503},{"style":2467},[2504],{"type":49,"value":2505}," aws_subnet.public_1",{"type":43,"tag":333,"props":2507,"children":2508},{"style":361},[2509],{"type":49,"value":2510}," '",{"type":43,"tag":333,"props":2512,"children":2513},{"style":2467},[2514],{"type":49,"value":2515},"module.vpc.aws_subnet.public[\"us-east-1a\"]",{"type":43,"tag":333,"props":2517,"children":2518},{"style":361},[2519],{"type":49,"value":2520},"'\n",{"type":43,"tag":333,"props":2522,"children":2523},{"class":335,"line":386},[2524,2528,2532,2536,2541,2545,2550],{"type":43,"tag":333,"props":2525,"children":2526},{"style":2462},[2527],{"type":49,"value":18},{"type":43,"tag":333,"props":2529,"children":2530},{"style":2467},[2531],{"type":49,"value":2470},{"type":43,"tag":333,"props":2533,"children":2534},{"style":2467},[2535],{"type":49,"value":2475},{"type":43,"tag":333,"props":2537,"children":2538},{"style":2467},[2539],{"type":49,"value":2540}," aws_subnet.public_2",{"type":43,"tag":333,"props":2542,"children":2543},{"style":361},[2544],{"type":49,"value":2510},{"type":43,"tag":333,"props":2546,"children":2547},{"style":2467},[2548],{"type":49,"value":2549},"module.vpc.aws_subnet.public[\"us-east-1b\"]",{"type":43,"tag":333,"props":2551,"children":2552},{"style":361},[2553],{"type":49,"value":2520},{"type":43,"tag":333,"props":2555,"children":2556},{"class":335,"line":399},[2557,2561,2565,2569,2574,2578,2583],{"type":43,"tag":333,"props":2558,"children":2559},{"style":2462},[2560],{"type":49,"value":18},{"type":43,"tag":333,"props":2562,"children":2563},{"style":2467},[2564],{"type":49,"value":2470},{"type":43,"tag":333,"props":2566,"children":2567},{"style":2467},[2568],{"type":49,"value":2475},{"type":43,"tag":333,"props":2570,"children":2571},{"style":2467},[2572],{"type":49,"value":2573}," aws_internet_gateway.main",{"type":43,"tag":333,"props":2575,"children":2576},{"style":361},[2577],{"type":49,"value":2510},{"type":43,"tag":333,"props":2579,"children":2580},{"style":2467},[2581],{"type":49,"value":2582},"module.vpc.aws_internet_gateway.main[0]",{"type":43,"tag":333,"props":2584,"children":2585},{"style":361},[2586],{"type":49,"value":2520},{"type":43,"tag":315,"props":2588,"children":2590},{"id":2589},"_5-module-documentation",[2591],{"type":49,"value":2592},"5. Module Documentation",{"type":43,"tag":322,"props":2594,"children":2596},{"className":324,"code":2595,"language":326,"meta":327,"style":327},"# VPC Module\n\n## Overview\nCreates a VPC with configurable public and private subnets across multiple availability zones.\n\n## Features\n- Multi-AZ subnet deployment\n- Optional NAT gateway configuration\n- VPC Flow Logs integration\n- Customizable CIDR allocation\n\n## Usage\n\n\\`\\`\\`hcl\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n\n  name               = \"my-vpc\"\n  cidr_block         = \"10.0.0.0\u002F16\"\n  availability_zones = [\"us-east-1a\", \"us-east-1b\"]\n\n  create_public_subnets  = true\n  create_private_subnets = true\n  enable_nat_gateway     = true\n\n  tags = {\n    Environment = \"production\"\n  }\n}\n\\`\\`\\`\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | >= 1.5.0 |\n| aws | ~> 5.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| name | Name prefix for resources | `string` | n\u002Fa | yes |\n| cidr_block | VPC CIDR block | `string` | n\u002Fa | yes |\n| availability_zones | List of AZs | `list(string)` | n\u002Fa | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| vpc_id | VPC identifier |\n| public_subnet_ids | Map of public subnet IDs |\n| private_subnet_ids | Map of private subnet IDs |\n\n## Examples\n\nSee [examples\u002F](.\u002Fexamples\u002F) directory for complete usage examples.\n",[2597],{"type":43,"tag":185,"props":2598,"children":2599},{"__ignoreMap":327},[2600,2613,2620,2633,2641,2648,2660,2672,2684,2696,2708,2715,2727,2734,2742,2749,2756,2763,2771,2778,2786,2793,2801,2809,2817,2824,2831,2838,2845,2852,2860,2867,2879,2886,2913,2921,2946,2971,2978,2990,2997,3048,3056,3118,3175,3233,3240,3252,3259,3282,3290,3315,3340,3365,3372,3384,3391],{"type":43,"tag":333,"props":2601,"children":2602},{"class":335,"line":336},[2603,2608],{"type":43,"tag":333,"props":2604,"children":2605},{"style":361},[2606],{"type":49,"value":2607},"# ",{"type":43,"tag":333,"props":2609,"children":2610},{"style":2462},[2611],{"type":49,"value":2612},"VPC Module\n",{"type":43,"tag":333,"props":2614,"children":2615},{"class":335,"line":357},[2616],{"type":43,"tag":333,"props":2617,"children":2618},{"emptyLinePlaceholder":429},[2619],{"type":49,"value":432},{"type":43,"tag":333,"props":2621,"children":2622},{"class":335,"line":373},[2623,2628],{"type":43,"tag":333,"props":2624,"children":2625},{"style":361},[2626],{"type":49,"value":2627},"## ",{"type":43,"tag":333,"props":2629,"children":2630},{"style":2462},[2631],{"type":49,"value":2632},"Overview\n",{"type":43,"tag":333,"props":2634,"children":2635},{"class":335,"line":386},[2636],{"type":43,"tag":333,"props":2637,"children":2638},{"style":367},[2639],{"type":49,"value":2640},"Creates a VPC with configurable public and private subnets across multiple availability zones.\n",{"type":43,"tag":333,"props":2642,"children":2643},{"class":335,"line":399},[2644],{"type":43,"tag":333,"props":2645,"children":2646},{"emptyLinePlaceholder":429},[2647],{"type":49,"value":432},{"type":43,"tag":333,"props":2649,"children":2650},{"class":335,"line":412},[2651,2655],{"type":43,"tag":333,"props":2652,"children":2653},{"style":361},[2654],{"type":49,"value":2627},{"type":43,"tag":333,"props":2656,"children":2657},{"style":2462},[2658],{"type":49,"value":2659},"Features\n",{"type":43,"tag":333,"props":2661,"children":2662},{"class":335,"line":425},[2663,2667],{"type":43,"tag":333,"props":2664,"children":2665},{"style":361},[2666],{"type":49,"value":364},{"type":43,"tag":333,"props":2668,"children":2669},{"style":367},[2670],{"type":49,"value":2671}," Multi-AZ subnet deployment\n",{"type":43,"tag":333,"props":2673,"children":2674},{"class":335,"line":435},[2675,2679],{"type":43,"tag":333,"props":2676,"children":2677},{"style":361},[2678],{"type":49,"value":364},{"type":43,"tag":333,"props":2680,"children":2681},{"style":367},[2682],{"type":49,"value":2683}," Optional NAT gateway configuration\n",{"type":43,"tag":333,"props":2685,"children":2686},{"class":335,"line":452},[2687,2691],{"type":43,"tag":333,"props":2688,"children":2689},{"style":361},[2690],{"type":49,"value":364},{"type":43,"tag":333,"props":2692,"children":2693},{"style":367},[2694],{"type":49,"value":2695}," VPC Flow Logs integration\n",{"type":43,"tag":333,"props":2697,"children":2698},{"class":335,"line":465},[2699,2703],{"type":43,"tag":333,"props":2700,"children":2701},{"style":361},[2702],{"type":49,"value":364},{"type":43,"tag":333,"props":2704,"children":2705},{"style":367},[2706],{"type":49,"value":2707}," Customizable CIDR allocation\n",{"type":43,"tag":333,"props":2709,"children":2710},{"class":335,"line":478},[2711],{"type":43,"tag":333,"props":2712,"children":2713},{"emptyLinePlaceholder":429},[2714],{"type":49,"value":432},{"type":43,"tag":333,"props":2716,"children":2717},{"class":335,"line":491},[2718,2722],{"type":43,"tag":333,"props":2719,"children":2720},{"style":361},[2721],{"type":49,"value":2627},{"type":43,"tag":333,"props":2723,"children":2724},{"style":2462},[2725],{"type":49,"value":2726},"Usage\n",{"type":43,"tag":333,"props":2728,"children":2729},{"class":335,"line":621},[2730],{"type":43,"tag":333,"props":2731,"children":2732},{"emptyLinePlaceholder":429},[2733],{"type":49,"value":432},{"type":43,"tag":333,"props":2735,"children":2736},{"class":335,"line":630},[2737],{"type":43,"tag":333,"props":2738,"children":2739},{"style":367},[2740],{"type":49,"value":2741},"\\`\\`\\`hcl\n",{"type":43,"tag":333,"props":2743,"children":2744},{"class":335,"line":639},[2745],{"type":43,"tag":333,"props":2746,"children":2747},{"style":367},[2748],{"type":49,"value":2154},{"type":43,"tag":333,"props":2750,"children":2751},{"class":335,"line":647},[2752],{"type":43,"tag":333,"props":2753,"children":2754},{"style":367},[2755],{"type":49,"value":2163},{"type":43,"tag":333,"props":2757,"children":2758},{"class":335,"line":656},[2759],{"type":43,"tag":333,"props":2760,"children":2761},{"emptyLinePlaceholder":429},[2762],{"type":49,"value":432},{"type":43,"tag":333,"props":2764,"children":2765},{"class":335,"line":665},[2766],{"type":43,"tag":333,"props":2767,"children":2768},{"style":367},[2769],{"type":49,"value":2770},"  name               = \"my-vpc\"\n",{"type":43,"tag":333,"props":2772,"children":2773},{"class":335,"line":674},[2774],{"type":43,"tag":333,"props":2775,"children":2776},{"style":367},[2777],{"type":49,"value":2189},{"type":43,"tag":333,"props":2779,"children":2780},{"class":335,"line":683},[2781],{"type":43,"tag":333,"props":2782,"children":2783},{"style":367},[2784],{"type":49,"value":2785},"  availability_zones = [\"us-east-1a\", \"us-east-1b\"]\n",{"type":43,"tag":333,"props":2787,"children":2788},{"class":335,"line":691},[2789],{"type":43,"tag":333,"props":2790,"children":2791},{"emptyLinePlaceholder":429},[2792],{"type":49,"value":432},{"type":43,"tag":333,"props":2794,"children":2795},{"class":335,"line":699},[2796],{"type":43,"tag":333,"props":2797,"children":2798},{"style":367},[2799],{"type":49,"value":2800},"  create_public_subnets  = true\n",{"type":43,"tag":333,"props":2802,"children":2803},{"class":335,"line":708},[2804],{"type":43,"tag":333,"props":2805,"children":2806},{"style":367},[2807],{"type":49,"value":2808},"  create_private_subnets = true\n",{"type":43,"tag":333,"props":2810,"children":2811},{"class":335,"line":717},[2812],{"type":43,"tag":333,"props":2813,"children":2814},{"style":367},[2815],{"type":49,"value":2816},"  enable_nat_gateway     = true\n",{"type":43,"tag":333,"props":2818,"children":2819},{"class":335,"line":726},[2820],{"type":43,"tag":333,"props":2821,"children":2822},{"emptyLinePlaceholder":429},[2823],{"type":49,"value":432},{"type":43,"tag":333,"props":2825,"children":2826},{"class":335,"line":1067},[2827],{"type":43,"tag":333,"props":2828,"children":2829},{"style":367},[2830],{"type":49,"value":921},{"type":43,"tag":333,"props":2832,"children":2833},{"class":335,"line":1076},[2834],{"type":43,"tag":333,"props":2835,"children":2836},{"style":367},[2837],{"type":49,"value":2223},{"type":43,"tag":333,"props":2839,"children":2840},{"class":335,"line":1084},[2841],{"type":43,"tag":333,"props":2842,"children":2843},{"style":367},[2844],{"type":49,"value":627},{"type":43,"tag":333,"props":2846,"children":2847},{"class":335,"line":1092},[2848],{"type":43,"tag":333,"props":2849,"children":2850},{"style":367},[2851],{"type":49,"value":636},{"type":43,"tag":333,"props":2853,"children":2854},{"class":335,"line":1101},[2855],{"type":43,"tag":333,"props":2856,"children":2857},{"style":367},[2858],{"type":49,"value":2859},"\\`\\`\\`\n",{"type":43,"tag":333,"props":2861,"children":2862},{"class":335,"line":1109},[2863],{"type":43,"tag":333,"props":2864,"children":2865},{"emptyLinePlaceholder":429},[2866],{"type":49,"value":432},{"type":43,"tag":333,"props":2868,"children":2869},{"class":335,"line":1117},[2870,2874],{"type":43,"tag":333,"props":2871,"children":2872},{"style":361},[2873],{"type":49,"value":2627},{"type":43,"tag":333,"props":2875,"children":2876},{"style":2462},[2877],{"type":49,"value":2878},"Requirements\n",{"type":43,"tag":333,"props":2880,"children":2881},{"class":335,"line":1125},[2882],{"type":43,"tag":333,"props":2883,"children":2884},{"emptyLinePlaceholder":429},[2885],{"type":49,"value":432},{"type":43,"tag":333,"props":2887,"children":2888},{"class":335,"line":1133},[2889,2894,2899,2903,2908],{"type":43,"tag":333,"props":2890,"children":2891},{"style":361},[2892],{"type":49,"value":2893},"|",{"type":43,"tag":333,"props":2895,"children":2896},{"style":367},[2897],{"type":49,"value":2898}," Name ",{"type":43,"tag":333,"props":2900,"children":2901},{"style":361},[2902],{"type":49,"value":2893},{"type":43,"tag":333,"props":2904,"children":2905},{"style":367},[2906],{"type":49,"value":2907}," Version ",{"type":43,"tag":333,"props":2909,"children":2910},{"style":361},[2911],{"type":49,"value":2912},"|\n",{"type":43,"tag":333,"props":2914,"children":2915},{"class":335,"line":1142},[2916],{"type":43,"tag":333,"props":2917,"children":2918},{"style":361},[2919],{"type":49,"value":2920},"|------|---------|\n",{"type":43,"tag":333,"props":2922,"children":2923},{"class":335,"line":1151},[2924,2928,2933,2937,2942],{"type":43,"tag":333,"props":2925,"children":2926},{"style":361},[2927],{"type":49,"value":2893},{"type":43,"tag":333,"props":2929,"children":2930},{"style":367},[2931],{"type":49,"value":2932}," terraform ",{"type":43,"tag":333,"props":2934,"children":2935},{"style":361},[2936],{"type":49,"value":2893},{"type":43,"tag":333,"props":2938,"children":2939},{"style":367},[2940],{"type":49,"value":2941}," >= 1.5.0 ",{"type":43,"tag":333,"props":2943,"children":2944},{"style":361},[2945],{"type":49,"value":2912},{"type":43,"tag":333,"props":2947,"children":2948},{"class":335,"line":1159},[2949,2953,2958,2962,2967],{"type":43,"tag":333,"props":2950,"children":2951},{"style":361},[2952],{"type":49,"value":2893},{"type":43,"tag":333,"props":2954,"children":2955},{"style":367},[2956],{"type":49,"value":2957}," aws ",{"type":43,"tag":333,"props":2959,"children":2960},{"style":361},[2961],{"type":49,"value":2893},{"type":43,"tag":333,"props":2963,"children":2964},{"style":367},[2965],{"type":49,"value":2966}," ~> 5.0 ",{"type":43,"tag":333,"props":2968,"children":2969},{"style":361},[2970],{"type":49,"value":2912},{"type":43,"tag":333,"props":2972,"children":2973},{"class":335,"line":1167},[2974],{"type":43,"tag":333,"props":2975,"children":2976},{"emptyLinePlaceholder":429},[2977],{"type":49,"value":432},{"type":43,"tag":333,"props":2979,"children":2980},{"class":335,"line":1176},[2981,2985],{"type":43,"tag":333,"props":2982,"children":2983},{"style":361},[2984],{"type":49,"value":2627},{"type":43,"tag":333,"props":2986,"children":2987},{"style":2462},[2988],{"type":49,"value":2989},"Inputs\n",{"type":43,"tag":333,"props":2991,"children":2992},{"class":335,"line":1184},[2993],{"type":43,"tag":333,"props":2994,"children":2995},{"emptyLinePlaceholder":429},[2996],{"type":49,"value":432},{"type":43,"tag":333,"props":2998,"children":2999},{"class":335,"line":1192},[3000,3004,3008,3012,3017,3021,3026,3030,3035,3039,3044],{"type":43,"tag":333,"props":3001,"children":3002},{"style":361},[3003],{"type":49,"value":2893},{"type":43,"tag":333,"props":3005,"children":3006},{"style":367},[3007],{"type":49,"value":2898},{"type":43,"tag":333,"props":3009,"children":3010},{"style":361},[3011],{"type":49,"value":2893},{"type":43,"tag":333,"props":3013,"children":3014},{"style":367},[3015],{"type":49,"value":3016}," Description ",{"type":43,"tag":333,"props":3018,"children":3019},{"style":361},[3020],{"type":49,"value":2893},{"type":43,"tag":333,"props":3022,"children":3023},{"style":367},[3024],{"type":49,"value":3025}," Type ",{"type":43,"tag":333,"props":3027,"children":3028},{"style":361},[3029],{"type":49,"value":2893},{"type":43,"tag":333,"props":3031,"children":3032},{"style":367},[3033],{"type":49,"value":3034}," Default ",{"type":43,"tag":333,"props":3036,"children":3037},{"style":361},[3038],{"type":49,"value":2893},{"type":43,"tag":333,"props":3040,"children":3041},{"style":367},[3042],{"type":49,"value":3043}," Required ",{"type":43,"tag":333,"props":3045,"children":3046},{"style":361},[3047],{"type":49,"value":2912},{"type":43,"tag":333,"props":3049,"children":3050},{"class":335,"line":1200},[3051],{"type":43,"tag":333,"props":3052,"children":3053},{"style":361},[3054],{"type":49,"value":3055},"|------|-------------|------|---------|----------|\n",{"type":43,"tag":333,"props":3057,"children":3058},{"class":335,"line":1537},[3059,3063,3068,3072,3077,3081,3086,3090,3095,3100,3105,3109,3114],{"type":43,"tag":333,"props":3060,"children":3061},{"style":361},[3062],{"type":49,"value":2893},{"type":43,"tag":333,"props":3064,"children":3065},{"style":367},[3066],{"type":49,"value":3067}," name ",{"type":43,"tag":333,"props":3069,"children":3070},{"style":361},[3071],{"type":49,"value":2893},{"type":43,"tag":333,"props":3073,"children":3074},{"style":367},[3075],{"type":49,"value":3076}," Name prefix for resources ",{"type":43,"tag":333,"props":3078,"children":3079},{"style":361},[3080],{"type":49,"value":2893},{"type":43,"tag":333,"props":3082,"children":3083},{"style":361},[3084],{"type":49,"value":3085}," `",{"type":43,"tag":333,"props":3087,"children":3088},{"style":2467},[3089],{"type":49,"value":195},{"type":43,"tag":333,"props":3091,"children":3092},{"style":361},[3093],{"type":49,"value":3094},"`",{"type":43,"tag":333,"props":3096,"children":3097},{"style":361},[3098],{"type":49,"value":3099}," |",{"type":43,"tag":333,"props":3101,"children":3102},{"style":367},[3103],{"type":49,"value":3104}," n\u002Fa ",{"type":43,"tag":333,"props":3106,"children":3107},{"style":361},[3108],{"type":49,"value":2893},{"type":43,"tag":333,"props":3110,"children":3111},{"style":367},[3112],{"type":49,"value":3113}," yes ",{"type":43,"tag":333,"props":3115,"children":3116},{"style":361},[3117],{"type":49,"value":2912},{"type":43,"tag":333,"props":3119,"children":3120},{"class":335,"line":1546},[3121,3125,3130,3134,3139,3143,3147,3151,3155,3159,3163,3167,3171],{"type":43,"tag":333,"props":3122,"children":3123},{"style":361},[3124],{"type":49,"value":2893},{"type":43,"tag":333,"props":3126,"children":3127},{"style":367},[3128],{"type":49,"value":3129}," cidr_block ",{"type":43,"tag":333,"props":3131,"children":3132},{"style":361},[3133],{"type":49,"value":2893},{"type":43,"tag":333,"props":3135,"children":3136},{"style":367},[3137],{"type":49,"value":3138}," VPC CIDR block ",{"type":43,"tag":333,"props":3140,"children":3141},{"style":361},[3142],{"type":49,"value":2893},{"type":43,"tag":333,"props":3144,"children":3145},{"style":361},[3146],{"type":49,"value":3085},{"type":43,"tag":333,"props":3148,"children":3149},{"style":2467},[3150],{"type":49,"value":195},{"type":43,"tag":333,"props":3152,"children":3153},{"style":361},[3154],{"type":49,"value":3094},{"type":43,"tag":333,"props":3156,"children":3157},{"style":361},[3158],{"type":49,"value":3099},{"type":43,"tag":333,"props":3160,"children":3161},{"style":367},[3162],{"type":49,"value":3104},{"type":43,"tag":333,"props":3164,"children":3165},{"style":361},[3166],{"type":49,"value":2893},{"type":43,"tag":333,"props":3168,"children":3169},{"style":367},[3170],{"type":49,"value":3113},{"type":43,"tag":333,"props":3172,"children":3173},{"style":361},[3174],{"type":49,"value":2912},{"type":43,"tag":333,"props":3176,"children":3177},{"class":335,"line":1554},[3178,3182,3187,3191,3196,3200,3204,3209,3213,3217,3221,3225,3229],{"type":43,"tag":333,"props":3179,"children":3180},{"style":361},[3181],{"type":49,"value":2893},{"type":43,"tag":333,"props":3183,"children":3184},{"style":367},[3185],{"type":49,"value":3186}," availability_zones ",{"type":43,"tag":333,"props":3188,"children":3189},{"style":361},[3190],{"type":49,"value":2893},{"type":43,"tag":333,"props":3192,"children":3193},{"style":367},[3194],{"type":49,"value":3195}," List of AZs ",{"type":43,"tag":333,"props":3197,"children":3198},{"style":361},[3199],{"type":49,"value":2893},{"type":43,"tag":333,"props":3201,"children":3202},{"style":361},[3203],{"type":49,"value":3085},{"type":43,"tag":333,"props":3205,"children":3206},{"style":2467},[3207],{"type":49,"value":3208},"list(string)",{"type":43,"tag":333,"props":3210,"children":3211},{"style":361},[3212],{"type":49,"value":3094},{"type":43,"tag":333,"props":3214,"children":3215},{"style":361},[3216],{"type":49,"value":3099},{"type":43,"tag":333,"props":3218,"children":3219},{"style":367},[3220],{"type":49,"value":3104},{"type":43,"tag":333,"props":3222,"children":3223},{"style":361},[3224],{"type":49,"value":2893},{"type":43,"tag":333,"props":3226,"children":3227},{"style":367},[3228],{"type":49,"value":3113},{"type":43,"tag":333,"props":3230,"children":3231},{"style":361},[3232],{"type":49,"value":2912},{"type":43,"tag":333,"props":3234,"children":3235},{"class":335,"line":1562},[3236],{"type":43,"tag":333,"props":3237,"children":3238},{"emptyLinePlaceholder":429},[3239],{"type":49,"value":432},{"type":43,"tag":333,"props":3241,"children":3242},{"class":335,"line":1570},[3243,3247],{"type":43,"tag":333,"props":3244,"children":3245},{"style":361},[3246],{"type":49,"value":2627},{"type":43,"tag":333,"props":3248,"children":3249},{"style":2462},[3250],{"type":49,"value":3251},"Outputs\n",{"type":43,"tag":333,"props":3253,"children":3254},{"class":335,"line":1578},[3255],{"type":43,"tag":333,"props":3256,"children":3257},{"emptyLinePlaceholder":429},[3258],{"type":49,"value":432},{"type":43,"tag":333,"props":3260,"children":3261},{"class":335,"line":1587},[3262,3266,3270,3274,3278],{"type":43,"tag":333,"props":3263,"children":3264},{"style":361},[3265],{"type":49,"value":2893},{"type":43,"tag":333,"props":3267,"children":3268},{"style":367},[3269],{"type":49,"value":2898},{"type":43,"tag":333,"props":3271,"children":3272},{"style":361},[3273],{"type":49,"value":2893},{"type":43,"tag":333,"props":3275,"children":3276},{"style":367},[3277],{"type":49,"value":3016},{"type":43,"tag":333,"props":3279,"children":3280},{"style":361},[3281],{"type":49,"value":2912},{"type":43,"tag":333,"props":3283,"children":3284},{"class":335,"line":1596},[3285],{"type":43,"tag":333,"props":3286,"children":3287},{"style":361},[3288],{"type":49,"value":3289},"|------|-------------|\n",{"type":43,"tag":333,"props":3291,"children":3292},{"class":335,"line":1605},[3293,3297,3302,3306,3311],{"type":43,"tag":333,"props":3294,"children":3295},{"style":361},[3296],{"type":49,"value":2893},{"type":43,"tag":333,"props":3298,"children":3299},{"style":367},[3300],{"type":49,"value":3301}," vpc_id ",{"type":43,"tag":333,"props":3303,"children":3304},{"style":361},[3305],{"type":49,"value":2893},{"type":43,"tag":333,"props":3307,"children":3308},{"style":367},[3309],{"type":49,"value":3310}," VPC identifier ",{"type":43,"tag":333,"props":3312,"children":3313},{"style":361},[3314],{"type":49,"value":2912},{"type":43,"tag":333,"props":3316,"children":3317},{"class":335,"line":1614},[3318,3322,3327,3331,3336],{"type":43,"tag":333,"props":3319,"children":3320},{"style":361},[3321],{"type":49,"value":2893},{"type":43,"tag":333,"props":3323,"children":3324},{"style":367},[3325],{"type":49,"value":3326}," public_subnet_ids ",{"type":43,"tag":333,"props":3328,"children":3329},{"style":361},[3330],{"type":49,"value":2893},{"type":43,"tag":333,"props":3332,"children":3333},{"style":367},[3334],{"type":49,"value":3335}," Map of public subnet IDs ",{"type":43,"tag":333,"props":3337,"children":3338},{"style":361},[3339],{"type":49,"value":2912},{"type":43,"tag":333,"props":3341,"children":3342},{"class":335,"line":1622},[3343,3347,3352,3356,3361],{"type":43,"tag":333,"props":3344,"children":3345},{"style":361},[3346],{"type":49,"value":2893},{"type":43,"tag":333,"props":3348,"children":3349},{"style":367},[3350],{"type":49,"value":3351}," private_subnet_ids ",{"type":43,"tag":333,"props":3353,"children":3354},{"style":361},[3355],{"type":49,"value":2893},{"type":43,"tag":333,"props":3357,"children":3358},{"style":367},[3359],{"type":49,"value":3360}," Map of private subnet IDs ",{"type":43,"tag":333,"props":3362,"children":3363},{"style":361},[3364],{"type":49,"value":2912},{"type":43,"tag":333,"props":3366,"children":3367},{"class":335,"line":1630},[3368],{"type":43,"tag":333,"props":3369,"children":3370},{"emptyLinePlaceholder":429},[3371],{"type":49,"value":432},{"type":43,"tag":333,"props":3373,"children":3374},{"class":335,"line":1639},[3375,3379],{"type":43,"tag":333,"props":3376,"children":3377},{"style":361},[3378],{"type":49,"value":2627},{"type":43,"tag":333,"props":3380,"children":3381},{"style":2462},[3382],{"type":49,"value":3383},"Examples\n",{"type":43,"tag":333,"props":3385,"children":3386},{"class":335,"line":1648},[3387],{"type":43,"tag":333,"props":3388,"children":3389},{"emptyLinePlaceholder":429},[3390],{"type":49,"value":432},{"type":43,"tag":333,"props":3392,"children":3393},{"class":335,"line":1656},[3394,3399,3404,3409,3414,3420,3425],{"type":43,"tag":333,"props":3395,"children":3396},{"style":367},[3397],{"type":49,"value":3398},"See ",{"type":43,"tag":333,"props":3400,"children":3401},{"style":361},[3402],{"type":49,"value":3403},"[",{"type":43,"tag":333,"props":3405,"children":3406},{"style":2467},[3407],{"type":49,"value":3408},"examples\u002F",{"type":43,"tag":333,"props":3410,"children":3411},{"style":361},[3412],{"type":49,"value":3413},"](",{"type":43,"tag":333,"props":3415,"children":3417},{"style":3416},"--shiki-light:#E53935;--shiki-light-text-decoration:underline;--shiki-default:#F07178;--shiki-default-text-decoration:underline;--shiki-dark:#F07178;--shiki-dark-text-decoration:underline",[3418],{"type":49,"value":3419},".\u002Fexamples\u002F",{"type":43,"tag":333,"props":3421,"children":3422},{"style":361},[3423],{"type":49,"value":3424},")",{"type":43,"tag":333,"props":3426,"children":3427},{"style":367},[3428],{"type":49,"value":3429}," directory for complete usage examples.\n",{"type":43,"tag":315,"props":3431,"children":3433},{"id":3432},"_6-testing",[3434],{"type":49,"value":3435},"6. Testing",{"type":43,"tag":59,"props":3437,"children":3438},{},[3439],{"type":49,"value":3440},"Use skill terraform-test",{"type":43,"tag":59,"props":3442,"children":3443},{},[3444,3450,3452,3458,3460,3466],{"type":43,"tag":3445,"props":3446,"children":3447},"strong",{},[3448],{"type":49,"value":3449},"Test File",{"type":49,"value":3451},": A ",{"type":43,"tag":185,"props":3453,"children":3455},{"className":3454},[],[3456],{"type":49,"value":3457},".tftest.hcl",{"type":49,"value":3459}," or ",{"type":43,"tag":185,"props":3461,"children":3463},{"className":3462},[],[3464],{"type":49,"value":3465},".tftest.json",{"type":49,"value":3467}," file containing test configuration and run blocks that validate your Terraform configuration.",{"type":43,"tag":59,"props":3469,"children":3470},{},[3471,3476],{"type":43,"tag":3445,"props":3472,"children":3473},{},[3474],{"type":49,"value":3475},"Test Block",{"type":49,"value":3477},": Optional configuration block that defines test-wide settings (available since Terraform 1.6.0).",{"type":43,"tag":59,"props":3479,"children":3480},{},[3481,3486],{"type":43,"tag":3445,"props":3482,"children":3483},{},[3484],{"type":49,"value":3485},"Run Block",{"type":49,"value":3487},": Defines a single test scenario with optional variables, provider configurations, and assertions. Each test file requires at least one run block.",{"type":43,"tag":59,"props":3489,"children":3490},{},[3491,3496],{"type":43,"tag":3445,"props":3492,"children":3493},{},[3494],{"type":49,"value":3495},"Assert Block",{"type":49,"value":3497},": Contains conditions that must evaluate to true for the test to pass. Failed assertions cause the test to fail.",{"type":43,"tag":59,"props":3499,"children":3500},{},[3501,3506],{"type":43,"tag":3445,"props":3502,"children":3503},{},[3504],{"type":49,"value":3505},"Mock Provider",{"type":49,"value":3507},": Simulates provider behavior without creating real infrastructure (available since Terraform 1.7.0).",{"type":43,"tag":59,"props":3509,"children":3510},{},[3511,3516],{"type":43,"tag":3445,"props":3512,"children":3513},{},[3514],{"type":49,"value":3515},"Test Modes",{"type":49,"value":3517},": Tests run in apply mode (default, creates real infrastructure) or plan mode (validates logic without creating resources).",{"type":43,"tag":509,"props":3519,"children":3521},{"id":3520},"file-structure",[3522],{"type":49,"value":3523},"File Structure",{"type":43,"tag":59,"props":3525,"children":3526},{},[3527,3529,3534,3535,3540,3542,3548],{"type":49,"value":3528},"Terraform test files use the ",{"type":43,"tag":185,"props":3530,"children":3532},{"className":3531},[],[3533],{"type":49,"value":3457},{"type":49,"value":3459},{"type":43,"tag":185,"props":3536,"children":3538},{"className":3537},[],[3539],{"type":49,"value":3465},{"type":49,"value":3541}," extension and are typically organized in a ",{"type":43,"tag":185,"props":3543,"children":3545},{"className":3544},[],[3546],{"type":49,"value":3547},"tests\u002F",{"type":49,"value":3549}," directory. Use clear naming conventions to distinguish between unit tests (plan mode) and integration tests (apply mode):",{"type":43,"tag":322,"props":3551,"children":3555},{"className":3552,"code":3554,"language":49},[3553],"language-text","my-module\u002F\n├── main.tf\n├── variables.tf\n├── outputs.tf\n└── tests\u002F\n    ├── unit_test.tftest.hcl      # Unit test (plan mode)\n    └── integration_test.tftest.hcl  # Integration test (apply mode - creates real resources)\n",[3556],{"type":43,"tag":185,"props":3557,"children":3558},{"__ignoreMap":327},[3559],{"type":49,"value":3554},{"type":43,"tag":52,"props":3561,"children":3563},{"id":3562},"refactoring-patterns",[3564],{"type":49,"value":3565},"Refactoring Patterns",{"type":43,"tag":315,"props":3567,"children":3569},{"id":3568},"pattern-1-resource-grouping",[3570],{"type":49,"value":3571},"Pattern 1: Resource Grouping",{"type":43,"tag":59,"props":3573,"children":3574},{},[3575],{"type":49,"value":3576},"Extract related resources into cohesive modules:",{"type":43,"tag":76,"props":3578,"children":3579},{},[3580,3585,3590],{"type":43,"tag":80,"props":3581,"children":3582},{},[3583],{"type":49,"value":3584},"Networking (VPC, Subnets, Route Tables)",{"type":43,"tag":80,"props":3586,"children":3587},{},[3588],{"type":49,"value":3589},"Compute (ASG, Launch Templates, Load Balancers)",{"type":43,"tag":80,"props":3591,"children":3592},{},[3593],{"type":49,"value":3594},"Data (RDS, ElastiCache, S3)",{"type":43,"tag":315,"props":3596,"children":3598},{"id":3597},"pattern-2-configuration-layering",[3599],{"type":49,"value":3600},"Pattern 2: Configuration Layering",{"type":43,"tag":322,"props":3602,"children":3604},{"className":517,"code":3603,"language":519,"meta":327,"style":327},"# Base module with defaults\nmodule \"vpc_base\" {\n  source = \".\u002Fmodules\u002Fvpc-base\"\n  # Minimal required inputs\n}\n\n# Environment-specific wrapper\nmodule \"vpc_prod\" {\n  source = \".\u002Fmodules\u002Fvpc-production\"\n  # Inherits from base, adds prod-specific config\n}\n",[3605],{"type":43,"tag":185,"props":3606,"children":3607},{"__ignoreMap":327},[3608,3616,3624,3632,3640,3647,3654,3662,3670,3678,3686],{"type":43,"tag":333,"props":3609,"children":3610},{"class":335,"line":336},[3611],{"type":43,"tag":333,"props":3612,"children":3613},{},[3614],{"type":49,"value":3615},"# Base module with defaults\n",{"type":43,"tag":333,"props":3617,"children":3618},{"class":335,"line":357},[3619],{"type":43,"tag":333,"props":3620,"children":3621},{},[3622],{"type":49,"value":3623},"module \"vpc_base\" {\n",{"type":43,"tag":333,"props":3625,"children":3626},{"class":335,"line":373},[3627],{"type":43,"tag":333,"props":3628,"children":3629},{},[3630],{"type":49,"value":3631},"  source = \".\u002Fmodules\u002Fvpc-base\"\n",{"type":43,"tag":333,"props":3633,"children":3634},{"class":335,"line":386},[3635],{"type":43,"tag":333,"props":3636,"children":3637},{},[3638],{"type":49,"value":3639},"  # Minimal required inputs\n",{"type":43,"tag":333,"props":3641,"children":3642},{"class":335,"line":399},[3643],{"type":43,"tag":333,"props":3644,"children":3645},{},[3646],{"type":49,"value":636},{"type":43,"tag":333,"props":3648,"children":3649},{"class":335,"line":412},[3650],{"type":43,"tag":333,"props":3651,"children":3652},{"emptyLinePlaceholder":429},[3653],{"type":49,"value":432},{"type":43,"tag":333,"props":3655,"children":3656},{"class":335,"line":425},[3657],{"type":43,"tag":333,"props":3658,"children":3659},{},[3660],{"type":49,"value":3661},"# Environment-specific wrapper\n",{"type":43,"tag":333,"props":3663,"children":3664},{"class":335,"line":435},[3665],{"type":43,"tag":333,"props":3666,"children":3667},{},[3668],{"type":49,"value":3669},"module \"vpc_prod\" {\n",{"type":43,"tag":333,"props":3671,"children":3672},{"class":335,"line":452},[3673],{"type":43,"tag":333,"props":3674,"children":3675},{},[3676],{"type":49,"value":3677},"  source = \".\u002Fmodules\u002Fvpc-production\"\n",{"type":43,"tag":333,"props":3679,"children":3680},{"class":335,"line":465},[3681],{"type":43,"tag":333,"props":3682,"children":3683},{},[3684],{"type":49,"value":3685},"  # Inherits from base, adds prod-specific config\n",{"type":43,"tag":333,"props":3687,"children":3688},{"class":335,"line":478},[3689],{"type":43,"tag":333,"props":3690,"children":3691},{},[3692],{"type":49,"value":636},{"type":43,"tag":315,"props":3694,"children":3696},{"id":3695},"pattern-3-composition",[3697],{"type":49,"value":3698},"Pattern 3: Composition",{"type":43,"tag":322,"props":3700,"children":3702},{"className":517,"code":3701,"language":519,"meta":327,"style":327},"# Small, focused modules\nmodule \"vpc\" {\n  source = \".\u002Fmodules\u002Fvpc\"\n}\n\nmodule \"security_groups\" {\n  source = \".\u002Fmodules\u002Fsecurity-groups\"\n  vpc_id = module.vpc.vpc_id\n}\n\nmodule \"application\" {\n  source     = \".\u002Fmodules\u002Fapplication\"\n  vpc_id     = module.vpc.vpc_id\n  subnet_ids = module.vpc.private_subnet_ids\n  sg_ids     = module.security_groups.app_sg_ids\n}\n",[3703],{"type":43,"tag":185,"props":3704,"children":3705},{"__ignoreMap":327},[3706,3714,3721,3728,3735,3742,3750,3758,3766,3773,3780,3788,3796,3804,3812,3820],{"type":43,"tag":333,"props":3707,"children":3708},{"class":335,"line":336},[3709],{"type":43,"tag":333,"props":3710,"children":3711},{},[3712],{"type":49,"value":3713},"# Small, focused modules\n",{"type":43,"tag":333,"props":3715,"children":3716},{"class":335,"line":357},[3717],{"type":43,"tag":333,"props":3718,"children":3719},{},[3720],{"type":49,"value":2154},{"type":43,"tag":333,"props":3722,"children":3723},{"class":335,"line":373},[3724],{"type":43,"tag":333,"props":3725,"children":3726},{},[3727],{"type":49,"value":2163},{"type":43,"tag":333,"props":3729,"children":3730},{"class":335,"line":386},[3731],{"type":43,"tag":333,"props":3732,"children":3733},{},[3734],{"type":49,"value":636},{"type":43,"tag":333,"props":3736,"children":3737},{"class":335,"line":399},[3738],{"type":43,"tag":333,"props":3739,"children":3740},{"emptyLinePlaceholder":429},[3741],{"type":49,"value":432},{"type":43,"tag":333,"props":3743,"children":3744},{"class":335,"line":412},[3745],{"type":43,"tag":333,"props":3746,"children":3747},{},[3748],{"type":49,"value":3749},"module \"security_groups\" {\n",{"type":43,"tag":333,"props":3751,"children":3752},{"class":335,"line":425},[3753],{"type":43,"tag":333,"props":3754,"children":3755},{},[3756],{"type":49,"value":3757},"  source = \".\u002Fmodules\u002Fsecurity-groups\"\n",{"type":43,"tag":333,"props":3759,"children":3760},{"class":335,"line":435},[3761],{"type":43,"tag":333,"props":3762,"children":3763},{},[3764],{"type":49,"value":3765},"  vpc_id = module.vpc.vpc_id\n",{"type":43,"tag":333,"props":3767,"children":3768},{"class":335,"line":452},[3769],{"type":43,"tag":333,"props":3770,"children":3771},{},[3772],{"type":49,"value":636},{"type":43,"tag":333,"props":3774,"children":3775},{"class":335,"line":465},[3776],{"type":43,"tag":333,"props":3777,"children":3778},{"emptyLinePlaceholder":429},[3779],{"type":49,"value":432},{"type":43,"tag":333,"props":3781,"children":3782},{"class":335,"line":478},[3783],{"type":43,"tag":333,"props":3784,"children":3785},{},[3786],{"type":49,"value":3787},"module \"application\" {\n",{"type":43,"tag":333,"props":3789,"children":3790},{"class":335,"line":491},[3791],{"type":43,"tag":333,"props":3792,"children":3793},{},[3794],{"type":49,"value":3795},"  source     = \".\u002Fmodules\u002Fapplication\"\n",{"type":43,"tag":333,"props":3797,"children":3798},{"class":335,"line":621},[3799],{"type":43,"tag":333,"props":3800,"children":3801},{},[3802],{"type":49,"value":3803},"  vpc_id     = module.vpc.vpc_id\n",{"type":43,"tag":333,"props":3805,"children":3806},{"class":335,"line":630},[3807],{"type":43,"tag":333,"props":3808,"children":3809},{},[3810],{"type":49,"value":3811},"  subnet_ids = module.vpc.private_subnet_ids\n",{"type":43,"tag":333,"props":3813,"children":3814},{"class":335,"line":639},[3815],{"type":43,"tag":333,"props":3816,"children":3817},{},[3818],{"type":49,"value":3819},"  sg_ids     = module.security_groups.app_sg_ids\n",{"type":43,"tag":333,"props":3821,"children":3822},{"class":335,"line":647},[3823],{"type":43,"tag":333,"props":3824,"children":3825},{},[3826],{"type":49,"value":636},{"type":43,"tag":52,"props":3828,"children":3830},{"id":3829},"common-pitfalls",[3831],{"type":49,"value":3832},"Common Pitfalls",{"type":43,"tag":315,"props":3834,"children":3836},{"id":3835},"_1-over-abstraction",[3837],{"type":49,"value":3838},"1. Over-Abstraction",{"type":43,"tag":322,"props":3840,"children":3842},{"className":517,"code":3841,"language":519,"meta":327,"style":327},"# ❌ Don't create overly generic modules\nvariable \"resources\" {\n  type = map(map(any))  # Too flexible, hard to validate\n}\n\n# ✅ Do use specific, typed interfaces\nvariable \"database_config\" {\n  type = object({\n    engine         = string\n    instance_class = string\n  })\n}\n",[3843],{"type":43,"tag":185,"props":3844,"children":3845},{"__ignoreMap":327},[3846,3854,3862,3870,3877,3884,3892,3900,3907,3915,3923,3930],{"type":43,"tag":333,"props":3847,"children":3848},{"class":335,"line":336},[3849],{"type":43,"tag":333,"props":3850,"children":3851},{},[3852],{"type":49,"value":3853},"# ❌ Don't create overly generic modules\n",{"type":43,"tag":333,"props":3855,"children":3856},{"class":335,"line":357},[3857],{"type":43,"tag":333,"props":3858,"children":3859},{},[3860],{"type":49,"value":3861},"variable \"resources\" {\n",{"type":43,"tag":333,"props":3863,"children":3864},{"class":335,"line":373},[3865],{"type":43,"tag":333,"props":3866,"children":3867},{},[3868],{"type":49,"value":3869},"  type = map(map(any))  # Too flexible, hard to validate\n",{"type":43,"tag":333,"props":3871,"children":3872},{"class":335,"line":386},[3873],{"type":43,"tag":333,"props":3874,"children":3875},{},[3876],{"type":49,"value":636},{"type":43,"tag":333,"props":3878,"children":3879},{"class":335,"line":399},[3880],{"type":43,"tag":333,"props":3881,"children":3882},{"emptyLinePlaceholder":429},[3883],{"type":49,"value":432},{"type":43,"tag":333,"props":3885,"children":3886},{"class":335,"line":412},[3887],{"type":43,"tag":333,"props":3888,"children":3889},{},[3890],{"type":49,"value":3891},"# ✅ Do use specific, typed interfaces\n",{"type":43,"tag":333,"props":3893,"children":3894},{"class":335,"line":425},[3895],{"type":43,"tag":333,"props":3896,"children":3897},{},[3898],{"type":49,"value":3899},"variable \"database_config\" {\n",{"type":43,"tag":333,"props":3901,"children":3902},{"class":335,"line":435},[3903],{"type":43,"tag":333,"props":3904,"children":3905},{},[3906],{"type":49,"value":555},{"type":43,"tag":333,"props":3908,"children":3909},{"class":335,"line":452},[3910],{"type":43,"tag":333,"props":3911,"children":3912},{},[3913],{"type":49,"value":3914},"    engine         = string\n",{"type":43,"tag":333,"props":3916,"children":3917},{"class":335,"line":465},[3918],{"type":43,"tag":333,"props":3919,"children":3920},{},[3921],{"type":49,"value":3922},"    instance_class = string\n",{"type":43,"tag":333,"props":3924,"children":3925},{"class":335,"line":478},[3926],{"type":43,"tag":333,"props":3927,"children":3928},{},[3929],{"type":49,"value":587},{"type":43,"tag":333,"props":3931,"children":3932},{"class":335,"line":491},[3933],{"type":43,"tag":333,"props":3934,"children":3935},{},[3936],{"type":49,"value":636},{"type":43,"tag":315,"props":3938,"children":3940},{"id":3939},"_2-tight-coupling",[3941],{"type":49,"value":3942},"2. Tight Coupling",{"type":43,"tag":322,"props":3944,"children":3946},{"className":517,"code":3945,"language":519,"meta":327,"style":327},"# ❌ Don't couple modules through direct references\n# module A\noutput \"instance_id\" { value = aws_instance.app.id }\n\n# module B (in same config)\nresource \"aws_eip\" \"app\" {\n  instance = module.a.instance_id  # Tight coupling\n}\n\n# ✅ Do pass dependencies through root module\nmodule \"compute\" {\n  source = \".\u002Fmodules\u002Fcompute\"\n}\n\nresource \"aws_eip\" \"app\" {\n  instance = module.compute.instance_id\n}\n",[3947],{"type":43,"tag":185,"props":3948,"children":3949},{"__ignoreMap":327},[3950,3958,3966,3974,3981,3989,3997,4005,4012,4019,4027,4035,4043,4050,4057,4064,4072],{"type":43,"tag":333,"props":3951,"children":3952},{"class":335,"line":336},[3953],{"type":43,"tag":333,"props":3954,"children":3955},{},[3956],{"type":49,"value":3957},"# ❌ Don't couple modules through direct references\n",{"type":43,"tag":333,"props":3959,"children":3960},{"class":335,"line":357},[3961],{"type":43,"tag":333,"props":3962,"children":3963},{},[3964],{"type":49,"value":3965},"# module A\n",{"type":43,"tag":333,"props":3967,"children":3968},{"class":335,"line":373},[3969],{"type":43,"tag":333,"props":3970,"children":3971},{},[3972],{"type":49,"value":3973},"output \"instance_id\" { value = aws_instance.app.id }\n",{"type":43,"tag":333,"props":3975,"children":3976},{"class":335,"line":386},[3977],{"type":43,"tag":333,"props":3978,"children":3979},{"emptyLinePlaceholder":429},[3980],{"type":49,"value":432},{"type":43,"tag":333,"props":3982,"children":3983},{"class":335,"line":399},[3984],{"type":43,"tag":333,"props":3985,"children":3986},{},[3987],{"type":49,"value":3988},"# module B (in same config)\n",{"type":43,"tag":333,"props":3990,"children":3991},{"class":335,"line":412},[3992],{"type":43,"tag":333,"props":3993,"children":3994},{},[3995],{"type":49,"value":3996},"resource \"aws_eip\" \"app\" {\n",{"type":43,"tag":333,"props":3998,"children":3999},{"class":335,"line":425},[4000],{"type":43,"tag":333,"props":4001,"children":4002},{},[4003],{"type":49,"value":4004},"  instance = module.a.instance_id  # Tight coupling\n",{"type":43,"tag":333,"props":4006,"children":4007},{"class":335,"line":435},[4008],{"type":43,"tag":333,"props":4009,"children":4010},{},[4011],{"type":49,"value":636},{"type":43,"tag":333,"props":4013,"children":4014},{"class":335,"line":452},[4015],{"type":43,"tag":333,"props":4016,"children":4017},{"emptyLinePlaceholder":429},[4018],{"type":49,"value":432},{"type":43,"tag":333,"props":4020,"children":4021},{"class":335,"line":465},[4022],{"type":43,"tag":333,"props":4023,"children":4024},{},[4025],{"type":49,"value":4026},"# ✅ Do pass dependencies through root module\n",{"type":43,"tag":333,"props":4028,"children":4029},{"class":335,"line":478},[4030],{"type":43,"tag":333,"props":4031,"children":4032},{},[4033],{"type":49,"value":4034},"module \"compute\" {\n",{"type":43,"tag":333,"props":4036,"children":4037},{"class":335,"line":491},[4038],{"type":43,"tag":333,"props":4039,"children":4040},{},[4041],{"type":49,"value":4042},"  source = \".\u002Fmodules\u002Fcompute\"\n",{"type":43,"tag":333,"props":4044,"children":4045},{"class":335,"line":621},[4046],{"type":43,"tag":333,"props":4047,"children":4048},{},[4049],{"type":49,"value":636},{"type":43,"tag":333,"props":4051,"children":4052},{"class":335,"line":630},[4053],{"type":43,"tag":333,"props":4054,"children":4055},{"emptyLinePlaceholder":429},[4056],{"type":49,"value":432},{"type":43,"tag":333,"props":4058,"children":4059},{"class":335,"line":639},[4060],{"type":43,"tag":333,"props":4061,"children":4062},{},[4063],{"type":49,"value":3996},{"type":43,"tag":333,"props":4065,"children":4066},{"class":335,"line":647},[4067],{"type":43,"tag":333,"props":4068,"children":4069},{},[4070],{"type":49,"value":4071},"  instance = module.compute.instance_id\n",{"type":43,"tag":333,"props":4073,"children":4074},{"class":335,"line":656},[4075],{"type":43,"tag":333,"props":4076,"children":4077},{},[4078],{"type":49,"value":636},{"type":43,"tag":315,"props":4080,"children":4082},{"id":4081},"_3-state-migration-errors",[4083],{"type":49,"value":4084},"3. State Migration Errors",{"type":43,"tag":59,"props":4086,"children":4087},{},[4088],{"type":49,"value":4089},"Always test migration in non-production first:",{"type":43,"tag":322,"props":4091,"children":4093},{"className":2441,"code":4092,"language":2443,"meta":327,"style":327},"# Create plan to verify no changes after migration\nterraform plan -out=migration.tfplan\n\n# Review carefully\nterraform show migration.tfplan\n\n# Apply only if plan shows no changes\nterraform apply migration.tfplan\n",[4094],{"type":43,"tag":185,"props":4095,"children":4096},{"__ignoreMap":327},[4097,4105,4122,4129,4137,4154,4161,4169],{"type":43,"tag":333,"props":4098,"children":4099},{"class":335,"line":336},[4100],{"type":43,"tag":333,"props":4101,"children":4102},{"style":2453},[4103],{"type":49,"value":4104},"# Create plan to verify no changes after migration\n",{"type":43,"tag":333,"props":4106,"children":4107},{"class":335,"line":357},[4108,4112,4117],{"type":43,"tag":333,"props":4109,"children":4110},{"style":2462},[4111],{"type":49,"value":18},{"type":43,"tag":333,"props":4113,"children":4114},{"style":2467},[4115],{"type":49,"value":4116}," plan",{"type":43,"tag":333,"props":4118,"children":4119},{"style":2467},[4120],{"type":49,"value":4121}," -out=migration.tfplan\n",{"type":43,"tag":333,"props":4123,"children":4124},{"class":335,"line":373},[4125],{"type":43,"tag":333,"props":4126,"children":4127},{"emptyLinePlaceholder":429},[4128],{"type":49,"value":432},{"type":43,"tag":333,"props":4130,"children":4131},{"class":335,"line":386},[4132],{"type":43,"tag":333,"props":4133,"children":4134},{"style":2453},[4135],{"type":49,"value":4136},"# Review carefully\n",{"type":43,"tag":333,"props":4138,"children":4139},{"class":335,"line":399},[4140,4144,4149],{"type":43,"tag":333,"props":4141,"children":4142},{"style":2462},[4143],{"type":49,"value":18},{"type":43,"tag":333,"props":4145,"children":4146},{"style":2467},[4147],{"type":49,"value":4148}," show",{"type":43,"tag":333,"props":4150,"children":4151},{"style":2467},[4152],{"type":49,"value":4153}," migration.tfplan\n",{"type":43,"tag":333,"props":4155,"children":4156},{"class":335,"line":412},[4157],{"type":43,"tag":333,"props":4158,"children":4159},{"emptyLinePlaceholder":429},[4160],{"type":49,"value":432},{"type":43,"tag":333,"props":4162,"children":4163},{"class":335,"line":425},[4164],{"type":43,"tag":333,"props":4165,"children":4166},{"style":2453},[4167],{"type":49,"value":4168},"# Apply only if plan shows no changes\n",{"type":43,"tag":333,"props":4170,"children":4171},{"class":335,"line":435},[4172,4176,4181],{"type":43,"tag":333,"props":4173,"children":4174},{"style":2462},[4175],{"type":49,"value":18},{"type":43,"tag":333,"props":4177,"children":4178},{"style":2467},[4179],{"type":49,"value":4180}," apply",{"type":43,"tag":333,"props":4182,"children":4183},{"style":2467},[4184],{"type":49,"value":4153},{"type":43,"tag":52,"props":4186,"children":4188},{"id":4187},"version-control-strategy",[4189],{"type":49,"value":4190},"Version Control Strategy",{"type":43,"tag":322,"props":4192,"children":4194},{"className":517,"code":4193,"language":519,"meta":327,"style":327},"# Use semantic versioning for modules\nmodule \"vpc\" {\n  source  = \"git::https:\u002F\u002Fgithub.com\u002Forg\u002Fterraform-modules.git\u002F\u002Fvpc?ref=v1.2.0\"\n  version = \"~> 1.2\"\n}\n\n# Pin to specific versions in production\n# Use version ranges in development\n",[4195],{"type":43,"tag":185,"props":4196,"children":4197},{"__ignoreMap":327},[4198,4206,4213,4221,4229,4236,4243,4251],{"type":43,"tag":333,"props":4199,"children":4200},{"class":335,"line":336},[4201],{"type":43,"tag":333,"props":4202,"children":4203},{},[4204],{"type":49,"value":4205},"# Use semantic versioning for modules\n",{"type":43,"tag":333,"props":4207,"children":4208},{"class":335,"line":357},[4209],{"type":43,"tag":333,"props":4210,"children":4211},{},[4212],{"type":49,"value":2154},{"type":43,"tag":333,"props":4214,"children":4215},{"class":335,"line":373},[4216],{"type":43,"tag":333,"props":4217,"children":4218},{},[4219],{"type":49,"value":4220},"  source  = \"git::https:\u002F\u002Fgithub.com\u002Forg\u002Fterraform-modules.git\u002F\u002Fvpc?ref=v1.2.0\"\n",{"type":43,"tag":333,"props":4222,"children":4223},{"class":335,"line":386},[4224],{"type":43,"tag":333,"props":4225,"children":4226},{},[4227],{"type":49,"value":4228},"  version = \"~> 1.2\"\n",{"type":43,"tag":333,"props":4230,"children":4231},{"class":335,"line":399},[4232],{"type":43,"tag":333,"props":4233,"children":4234},{},[4235],{"type":49,"value":636},{"type":43,"tag":333,"props":4237,"children":4238},{"class":335,"line":412},[4239],{"type":43,"tag":333,"props":4240,"children":4241},{"emptyLinePlaceholder":429},[4242],{"type":49,"value":432},{"type":43,"tag":333,"props":4244,"children":4245},{"class":335,"line":425},[4246],{"type":43,"tag":333,"props":4247,"children":4248},{},[4249],{"type":49,"value":4250},"# Pin to specific versions in production\n",{"type":43,"tag":333,"props":4252,"children":4253},{"class":335,"line":435},[4254],{"type":43,"tag":333,"props":4255,"children":4256},{},[4257],{"type":49,"value":4258},"# Use version ranges in development\n",{"type":43,"tag":52,"props":4260,"children":4262},{"id":4261},"success-criteria",[4263],{"type":49,"value":4264},"Success Criteria",{"type":43,"tag":76,"props":4266,"children":4269},{"className":4267},[4268],"contains-task-list",[4270,4282,4291,4300,4309,4318,4327,4336],{"type":43,"tag":80,"props":4271,"children":4274},{"className":4272},[4273],"task-list-item",[4275,4280],{"type":43,"tag":4276,"props":4277,"children":4279},"input",{"disabled":429,"type":4278},"checkbox",[],{"type":49,"value":4281}," Module has single, well-defined responsibility",{"type":43,"tag":80,"props":4283,"children":4285},{"className":4284},[4273],[4286,4289],{"type":43,"tag":4276,"props":4287,"children":4288},{"disabled":429,"type":4278},[],{"type":49,"value":4290}," All variables have descriptions and types",{"type":43,"tag":80,"props":4292,"children":4294},{"className":4293},[4273],[4295,4298],{"type":43,"tag":4276,"props":4296,"children":4297},{"disabled":429,"type":4278},[],{"type":49,"value":4299}," Validation rules prevent invalid configurations",{"type":43,"tag":80,"props":4301,"children":4303},{"className":4302},[4273],[4304,4307],{"type":43,"tag":4276,"props":4305,"children":4306},{"disabled":429,"type":4278},[],{"type":49,"value":4308}," Outputs provide sufficient information for consumers",{"type":43,"tag":80,"props":4310,"children":4312},{"className":4311},[4273],[4313,4316],{"type":43,"tag":4276,"props":4314,"children":4315},{"disabled":429,"type":4278},[],{"type":49,"value":4317}," Documentation includes usage examples",{"type":43,"tag":80,"props":4319,"children":4321},{"className":4320},[4273],[4322,4325],{"type":43,"tag":4276,"props":4323,"children":4324},{"disabled":429,"type":4278},[],{"type":49,"value":4326}," Tests verify module behavior",{"type":43,"tag":80,"props":4328,"children":4330},{"className":4329},[4273],[4331,4334],{"type":43,"tag":4276,"props":4332,"children":4333},{"disabled":429,"type":4278},[],{"type":49,"value":4335}," State migration completed without resource recreation",{"type":43,"tag":80,"props":4337,"children":4339},{"className":4338},[4273],[4340,4343],{"type":43,"tag":4276,"props":4341,"children":4342},{"disabled":429,"type":4278},[],{"type":49,"value":4344}," No plan differences after refactoring",{"type":43,"tag":52,"props":4346,"children":4348},{"id":4347},"related-skills",[4349],{"type":49,"value":4350},"Related Skills",{"type":43,"tag":76,"props":4352,"children":4353},{},[4354,4368],{"type":43,"tag":80,"props":4355,"children":4356},{},[4357,4366],{"type":43,"tag":4358,"props":4359,"children":4363},"a",{"href":4360,"rel":4361},"https:\u002F\u002Fraw.githubusercontent.com\u002Fhashicorp\u002Fagent-skills\u002Frefs\u002Fheads\u002Fmain\u002Fterraform\u002Fcode-generation\u002Fskills\u002Fterraform-style-guide\u002FSKILL.md",[4362],"nofollow",[4364],{"type":49,"value":4365},"Terraform code generation",{"type":49,"value":4367}," - Style guide for the new Terraform Module",{"type":43,"tag":80,"props":4369,"children":4370},{},[4371,4378],{"type":43,"tag":4358,"props":4372,"children":4375},{"href":4373,"rel":4374},"https:\u002F\u002Fraw.githubusercontent.com\u002Fhashicorp\u002Fagent-skills\u002Frefs\u002Fheads\u002Fmain\u002Fterraform\u002Fcode-generation\u002Fskills\u002Fazure-verified-modules\u002FSKILL.md",[4362],[4376],{"type":49,"value":4377},"Azure Verified Modules",{"type":49,"value":4379}," - Recommended module specifications for Azure",{"type":43,"tag":52,"props":4381,"children":4383},{"id":4382},"resources",[4384],{"type":49,"value":4385},"Resources",{"type":43,"tag":76,"props":4387,"children":4388},{},[4389,4399],{"type":43,"tag":80,"props":4390,"children":4391},{},[4392],{"type":43,"tag":4358,"props":4393,"children":4396},{"href":4394,"rel":4395},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Flanguage\u002Fmodules\u002Fdevelop",[4362],[4397],{"type":49,"value":4398},"Terraform Module Development",{"type":43,"tag":80,"props":4400,"children":4401},{},[4402],{"type":43,"tag":4358,"props":4403,"children":4406},{"href":4404,"rel":4405},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Fcloud-docs\u002Fregistry\u002Fdesign",[4362],[4407],{"type":49,"value":4408},"Module Best Practices",{"type":43,"tag":52,"props":4410,"children":4412},{"id":4411},"revision-history",[4413],{"type":49,"value":4414},"Revision History",{"type":43,"tag":141,"props":4416,"children":4417},{},[4418,4439],{"type":43,"tag":145,"props":4419,"children":4420},{},[4421],{"type":43,"tag":149,"props":4422,"children":4423},{},[4424,4429,4434],{"type":43,"tag":153,"props":4425,"children":4426},{},[4427],{"type":49,"value":4428},"Version",{"type":43,"tag":153,"props":4430,"children":4431},{},[4432],{"type":49,"value":4433},"Date",{"type":43,"tag":153,"props":4435,"children":4436},{},[4437],{"type":49,"value":4438},"Changes",{"type":43,"tag":174,"props":4440,"children":4441},{},[4442],{"type":43,"tag":149,"props":4443,"children":4444},{},[4445,4450,4455],{"type":43,"tag":181,"props":4446,"children":4447},{},[4448],{"type":49,"value":4449},"1.0.0",{"type":43,"tag":181,"props":4451,"children":4452},{},[4453],{"type":49,"value":4454},"2025-11-07",{"type":43,"tag":181,"props":4456,"children":4457},{},[4458],{"type":49,"value":4459},"Initial skill definition",{"type":43,"tag":4461,"props":4462,"children":4463},"style",{},[4464],{"type":49,"value":4465},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":4467,"total":656},[4468,4485,4497,4510,4524,4536,4550],{"slug":4469,"name":4469,"fn":4470,"description":4471,"org":4472,"tags":4473,"stars":22,"repoUrl":23,"updatedAt":4484},"aws-ami-builder","build Amazon Machine Images with Packer","Build Amazon Machine Images (AMIs) with Packer using the amazon-ebs builder. Use when creating custom AMIs for EC2 instances.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4474,4477,4480,4481],{"name":4475,"slug":4476,"type":15},"AWS","aws",{"name":4478,"slug":4479,"type":15},"Deployment","deployment",{"name":20,"slug":21,"type":15},{"name":4482,"slug":4483,"type":15},"Packer","packer","2026-04-06T18:25:04.01571",{"slug":4486,"name":4486,"fn":4487,"description":4488,"org":4489,"tags":4490,"stars":22,"repoUrl":23,"updatedAt":4496},"azure-image-builder","build Azure managed images with Packer","Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4491,4494,4495],{"name":4492,"slug":4493,"type":15},"Azure","azure",{"name":4478,"slug":4479,"type":15},{"name":4482,"slug":4483,"type":15},"2026-04-06T18:25:06.590174",{"slug":4498,"name":4498,"fn":4499,"description":4500,"org":4501,"tags":4502,"stars":22,"repoUrl":23,"updatedAt":4509},"azure-verified-modules","develop certified Azure Verified Modules","Azure Verified Modules (AVM) requirements and best practices for developing certified Azure Terraform modules. Use when creating or reviewing Azure modules that need AVM certification.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4503,4504,4507,4508],{"name":4492,"slug":4493,"type":15},{"name":4505,"slug":4506,"type":15},"Compliance","compliance",{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},"2026-04-06T18:25:16.88768",{"slug":4511,"name":4511,"fn":4512,"description":4513,"org":4514,"tags":4515,"stars":22,"repoUrl":23,"updatedAt":4523},"new-terraform-provider","scaffold new Terraform providers","Use this when scaffolding a new Terraform provider.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4516,4519,4522],{"name":4517,"slug":4518,"type":15},"Plugin Development","plugin-development",{"name":4520,"slug":4521,"type":15},"Templates","templates",{"name":17,"slug":18,"type":15},"2026-04-06T18:25:11.814973",{"slug":4525,"name":4525,"fn":4526,"description":4527,"org":4528,"tags":4529,"stars":22,"repoUrl":23,"updatedAt":4535},"provider-actions","implement Terraform Provider lifecycle actions","Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before\u002Fafter create, update, destroy).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4530,4533,4534],{"name":4531,"slug":4532,"type":15},"API Development","api-development",{"name":4517,"slug":4518,"type":15},{"name":17,"slug":18,"type":15},"2026-04-06T18:25:07.880533",{"slug":4537,"name":4537,"fn":4538,"description":4539,"org":4540,"tags":4541,"stars":22,"repoUrl":23,"updatedAt":4549},"provider-docs","generate and review Terraform provider documentation","Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema descriptions. Use when adding or changing provider configuration, resources, data sources, ephemeral resources, list resources, functions, or guides; when validating generated docs; and when troubleshooting missing or incorrect Registry documentation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4542,4545,4548],{"name":4543,"slug":4544,"type":15},"Documentation","documentation",{"name":4546,"slug":4547,"type":15},"Technical Writing","technical-writing",{"name":17,"slug":18,"type":15},"2026-04-06T18:25:09.261559",{"slug":4551,"name":4551,"fn":4552,"description":4553,"org":4554,"tags":4555,"stars":22,"repoUrl":23,"updatedAt":4559},"provider-resources","implement Terraform Provider resources and data sources","Implement Terraform Provider resources and data sources using the Plugin Framework. Use when developing CRUD operations, schema design, state management, and acceptance testing for provider resources.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4556,4557,4558],{"name":4531,"slug":4532,"type":15},{"name":4517,"slug":4518,"type":15},{"name":17,"slug":18,"type":15},"2026-04-06T18:25:10.56237",{"items":4561,"total":665},[4562,4569,4575,4582,4588,4594,4600,4606,4621,4636,4642,4653],{"slug":4469,"name":4469,"fn":4470,"description":4471,"org":4563,"tags":4564,"stars":22,"repoUrl":23,"updatedAt":4484},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4565,4566,4567,4568],{"name":4475,"slug":4476,"type":15},{"name":4478,"slug":4479,"type":15},{"name":20,"slug":21,"type":15},{"name":4482,"slug":4483,"type":15},{"slug":4486,"name":4486,"fn":4487,"description":4488,"org":4570,"tags":4571,"stars":22,"repoUrl":23,"updatedAt":4496},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4572,4573,4574],{"name":4492,"slug":4493,"type":15},{"name":4478,"slug":4479,"type":15},{"name":4482,"slug":4483,"type":15},{"slug":4498,"name":4498,"fn":4499,"description":4500,"org":4576,"tags":4577,"stars":22,"repoUrl":23,"updatedAt":4509},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4578,4579,4580,4581],{"name":4492,"slug":4493,"type":15},{"name":4505,"slug":4506,"type":15},{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"slug":4511,"name":4511,"fn":4512,"description":4513,"org":4583,"tags":4584,"stars":22,"repoUrl":23,"updatedAt":4523},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4585,4586,4587],{"name":4517,"slug":4518,"type":15},{"name":4520,"slug":4521,"type":15},{"name":17,"slug":18,"type":15},{"slug":4525,"name":4525,"fn":4526,"description":4527,"org":4589,"tags":4590,"stars":22,"repoUrl":23,"updatedAt":4535},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4591,4592,4593],{"name":4531,"slug":4532,"type":15},{"name":4517,"slug":4518,"type":15},{"name":17,"slug":18,"type":15},{"slug":4537,"name":4537,"fn":4538,"description":4539,"org":4595,"tags":4596,"stars":22,"repoUrl":23,"updatedAt":4549},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4597,4598,4599],{"name":4543,"slug":4544,"type":15},{"name":4546,"slug":4547,"type":15},{"name":17,"slug":18,"type":15},{"slug":4551,"name":4551,"fn":4552,"description":4553,"org":4601,"tags":4602,"stars":22,"repoUrl":23,"updatedAt":4559},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4603,4604,4605],{"name":4531,"slug":4532,"type":15},{"name":4517,"slug":4518,"type":15},{"name":17,"slug":18,"type":15},{"slug":4607,"name":4607,"fn":4608,"description":4609,"org":4610,"tags":4611,"stars":22,"repoUrl":23,"updatedAt":4620},"provider-test-patterns","implement Terraform provider acceptance test patterns","Terraform provider acceptance test patterns using terraform-plugin-testing with the Plugin Framework. Covers test structure, TestCase\u002FTestStep fields, ConfigStateChecks with custom statecheck.StateCheck implementations, plan checks, CompareValue for cross-step assertions, config helpers, import testing with ImportStateKind, sweepers, and scenario patterns (basic, update, disappears, validation, regression), and ephemeral resource testing with the echoprovider package. Use when writing, reviewing, or debugging provider acceptance tests, including questions about statecheck, plancheck, TestCheckFunc, CheckDestroy, ExpectError, import state verification, ephemeral resources, or how to structure test files.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4612,4613,4616,4617],{"name":4517,"slug":4518,"type":15},{"name":4614,"slug":4615,"type":15},"QA","qa",{"name":17,"slug":18,"type":15},{"name":4618,"slug":4619,"type":15},"Testing","testing","2026-04-06T18:25:14.352781",{"slug":4622,"name":4622,"fn":4623,"description":4624,"org":4625,"tags":4626,"stars":22,"repoUrl":23,"updatedAt":4635},"push-to-registry","push Packer build metadata to HCP registry","Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4627,4628,4631,4634],{"name":4478,"slug":4479,"type":15},{"name":4629,"slug":4630,"type":15},"Governance","governance",{"name":4632,"slug":4633,"type":15},"HCP","hcp",{"name":4482,"slug":4483,"type":15},"2026-04-06T18:25:02.749563",{"slug":4,"name":4,"fn":5,"description":6,"org":4637,"tags":4638,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4639,4640,4641],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"slug":4643,"name":4643,"fn":4644,"description":4645,"org":4646,"tags":4647,"stars":22,"repoUrl":23,"updatedAt":4652},"run-acceptance-tests","run acceptance tests for Terraform providers","Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4648,4649,4650,4651],{"name":4517,"slug":4518,"type":15},{"name":4614,"slug":4615,"type":15},{"name":17,"slug":18,"type":15},{"name":4618,"slug":4619,"type":15},"2026-04-06T18:25:13.098191",{"slug":4654,"name":4654,"fn":4655,"description":4656,"org":4657,"tags":4658,"stars":22,"repoUrl":23,"updatedAt":4665},"terraform-policy","write and test Terraform policy files","Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy, write a policy.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4659,4660,4661,4664],{"name":4505,"slug":4506,"type":15},{"name":20,"slug":21,"type":15},{"name":4662,"slug":4663,"type":15},"Security","security",{"name":17,"slug":18,"type":15},"2026-07-18T05:48:20.299442"]