Found a bug? Maybe our Slack Community can help.
![Slack Community](https://camo.githubusercontent.com/918cb6811c8aca91fc75967e3e056f0513f7ea3c3d152ab66bba59593fc292d2/68747470733a2f2f736c61636b2e636c6f7564706f7373652e636f6d2f62616467652e737667)
Describe the Bug
Hitting something related with the latest AWS provider as of right now (3.34.0) which adds some new validation enhancements with aws_route
: "resource/aws_route: Validate route destination and target attributes (#16930)".
The module was provisioned using the 3.33.0 version of the AWS provider. Then after updating to 3.34.0 via terraform init -upgrade
, the following errors occur during terraform plan
:
Error: ExactlyOne
on .terraform/modules/us_east_1a_private_subnets/private.tf line 41, in resource "aws_route" "private":
41: resource "aws_route" "private" {
"vpc_endpoint_id": only one of
`egress_only_gateway_id,gateway_id,instance_id,local_gateway_id,nat_gateway_id,network_interface_id,transit_gateway_id,vpc_endpoint_id,vpc_peering_connection_id`
can be specified, but `nat_gateway_id,network_interface_id` were specified.
I believe it's getting a list value of nat_gateway_id,network_interface_id
and expecting a single value of nat_gateway_id
or network_interface_id
.
I don't think the values matter but this is the config, very much similar like the examples:
module "vpc" {
source = "cloudposse/vpc/aws"
version = "0.21.1"
context = module.this.context
cidr_block = var.vpc_cidr_block
}
locals {
us_east_1a_public_cidr_block = cidrsubnet(module.vpc.vpc_cidr_block, 2, 0)
us_east_1a_private_cidr_block = cidrsubnet(module.vpc.vpc_cidr_block, 2, 1)
}
module "us_east_1a_public_subnets" {
source = "cloudposse/named-subnets/aws"
version = "0.11.0"
context = module.this.context
subnet_names = var.public_subnet_names
vpc_id = module.vpc.vpc_id
cidr_block = local.us_east_1a_public_cidr_block
type = "public"
igw_id = module.vpc.igw_id
availability_zone = "us-east-1a"
attributes = ["us-east-1a"]
}
module "us_east_1a_private_subnets" {
source = "cloudposse/named-subnets/aws"
version = "0.11.0"
context = module.this.context
subnet_names = var.private_subnet_names
vpc_id = module.vpc.vpc_id
cidr_block = local.us_east_1a_private_cidr_block
type = "private"
availability_zone = "us-east-1a"
attributes = ["us-east-1a"]
ngw_id = module.us_east_1a_public_subnets.ngw_id
}
Expected Behavior
The infrastructure created by this module is compatible with the latest 3.34.0 AWS provider after being provisioned earlier using AWS provider 3.33.0.
Steps to Reproduce
Steps to reproduce the behavior:
- Provision examples config using AWS provider 3.33.0. (terraform init, terraform apply)
- Run
terraform init -upgrade
- Run
terraform play
- See error
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
- OS: OSX 10.15
- Terraform v0.14.7
Additional Context
Workaround is to pin the provider to 3.33.0 going forward but don't know yet what the remediation of this would be to get past 3.33.0.