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.97k stars 4.42k forks source link

Route table association issues #1083

Closed rappal closed 2 months ago

rappal commented 4 months ago

Description

If you don't create private subnets, but define the elasticache_subnets without a route table the module drops errors.

Code

https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/main.tf#L726 It should use the local.create_elasticache_route_table, because we set the value based on subnets and route table. (create_elasticache_route_table = local.create_elasticache_subnets && var.create_elasticache_subnet_route_table)

create_elasticache_route_table = local.create_elasticache_subnets && var.create_elasticache_subnet_route_table If var.create_elasticache_subnet_route_table has a false value then you have Elasticache subnets without a route table. The route table association with the original count line:

Error message

Error: Error in function call on .terraform/modules/vpc/main.tf line 730, in resource "aws_route_table_association" "elasticache": 730: coalescelist( 731: aws_route_table.elasticache[].id, 732: aws_route_table.private[].id, 733: ), β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ while calling coalescelist(vals...) β”‚ aws_route_table.elasticache is empty tuple β”‚ aws_route_table.private is empty tuple

Call to function "coalescelist" failed: no non-null arguments.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 2 months ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 month 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.