You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AWS provider since v5.31.0, validates that exactly one of either subnets or subnet_mapping is configured.
Currently, the terraform-aws-alb module uses [] as the default of subnets. It means module users who want to use subnet_mapping have to set subnets to null in order to avoid triggering validation error:
"subnet_mapping": only one of `subnet_mapping,subnets` can be specified, but `subnet_mapping,subnets` were specified.
✋ I have searched the open/closed issues and my issue is not listed.
terraform apply successfully creates the load balancer.
Actual behavior
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Invalid combination of arguments
│
│ with module.aws-load-balancer.aws_lb.this[0],
│ on .terraform/modules/aws-load-balancer/main.tf line 12, in resource "aws_lb" "this":
│ 12: resource "aws_lb" "this" {
│
│ "subnet_mapping": only one of `subnet_mapping,subnets` can be specified, but `subnet_mapping,subnets` were specified.
╵
╷
│ Error: Invalid combination of arguments
│
│ with module.aws-load-balancer.aws_lb.this[0],
│ on .terraform/modules/aws-load-balancer/main.tf line 65, in resource "aws_lb" "this":
│ 65: subnets = var.subnets
│
│ "subnets": only one of `subnet_mapping,subnets` can be specified, but `subnet_mapping,subnets` were specified.
Additional context
A workaround is to add subnets = null when using the module. Alternatively, use AWS provider < 5.31 (with terraform-aws-alb <= 9.2.0, because the later versions depends on AWS provider >= 5.31).
The text was updated successfully, but these errors were encountered:
andyli
added a commit
to andyli/terraform-aws-alb
that referenced
this issue
Jan 8, 2024
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.
Description
AWS provider since v5.31.0, validates that exactly one of either
subnets
orsubnet_mapping
is configured.Currently, the terraform-aws-alb module uses
[]
as the default ofsubnets
. It means module users who want to usesubnet_mapping
have to setsubnets
tonull
in order to avoid triggering validation error:Versions
9.4.0
v1.5.7
provider registry.terraform.io/hashicorp/aws v5.31.0
Reproduction Code [Required]
Expected behavior
terraform apply
successfully creates the load balancer.Actual behavior
Additional context
A workaround is to add
subnets = null
when using the module. Alternatively, use AWS provider < 5.31 (with terraform-aws-alb <= 9.2.0, because the later versions depends on AWS provider >= 5.31).The text was updated successfully, but these errors were encountered: