terraform-aws-modules / terraform-aws-vpc

Terraform module to create AWS VPC resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws
Apache License 2.0
2.99k stars 4.44k forks source link

VPC configuration started breaking. No changes made #930

Closed Tomperez98 closed 1 year ago

Tomperez98 commented 1 year ago

Description

I cannot enable_ipv6 in my VPC with the configuration I used to have.

module "my_private_vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "private-vpc"
  cidr = "10.0.0.0/16"

  azs                                            = ["${local.az}a", "${local.az}b"]
  private_subnets                                = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets                                 = ["10.0.101.0/24", "10.0.102.0/24"]

  enable_ipv6          = true
  enable_dns_hostnames = true
  enable_dns_support   = true

  enable_nat_gateway     = true
  single_nat_gateway     = true
  one_nat_gateway_per_az = false

}

I get

modifying EC2 Subnet (subnet-123) EnableDns64: InvalidParameterValue: Invalid value 'true' for enable-dns64. Cannot set enable-dns64 to true unless the subnet (subnet-123) has an IPv6 CIDR block associated with it.

But this wasn't happening before.

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Your version of Terraform is out of date! The latest version is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html


## Reproduction Code [Required]

```hcl
module "my_private_vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "private-vpc"
  cidr = "10.0.0.0/16"

  azs                                            = ["${local.az}a", "${local.az}b"]
  private_subnets                                = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets                                 = ["10.0.101.0/24", "10.0.102.0/24"]

  enable_ipv6          = true
  enable_dns_hostnames = true
  enable_dns_support   = true

  enable_nat_gateway     = true
  single_nat_gateway     = true
  one_nat_gateway_per_az = false

}

Steps to reproduce the behavior:

Expected behavior

To create the VPC as it was doing before

Actual behavior

Triggers and error

Terminal Output Screenshot(s)

image

Additional context

What am I missing

bryantbiggs commented 1 year ago

you should probably pin your version since v4 was released recently, or look at the changes made in v4 and align your code accordingly https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/UPGRADE-4.0.md

Tomperez98 commented 1 year ago

This solved this

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.