Not sure if this a bug but running into this . see my code below:
module "apps-elb" {
source = "terraform-aws-modules/elb/aws"
version = "~> 2.0"
name = local.formatted_apps_lb_name
subnets = var.subnets
security_groups = [aws_security_group.apps-elb.id]
internal = true
listener = [
{
instance_port = "30080"
instance_protocol = "TCP"
lb_port = "80"
lb_protocol = "tcp"
},
{
instance_port = "30443"
instance_protocol = "TCP"
lb_port = "443"
lb_protocol = "tcp"
},
]
health_check = {
target = "TCP:30080"
interval = 10
healthy_threshold = 2
unhealthy_threshold = 6
timeout = 5
}
module "admin-elb" {
source = "terraform-aws-modules/elb/aws"
version = "~> 2.0"
name = local.formatted_admin_lb_name
subnets = var.subnets
security_groups = [aws_security_group.admin-elb.id]
internal = true
listener = [
{
instance_port = "32020"
instance_protocol = "TCP"
lb_port = "15020"
lb_protocol = "tcp"
},
{
instance_port = "31080"
instance_protocol = "TCP"
lb_port = "80"
lb_protocol = "tcp"
},
{
instance_port = "32443"
instance_protocol = "TCP"
lb_port = "443"
lb_protocol = "tcp"
},
{
instance_port = "32029"
instance_protocol = "TCP"
lb_port = "15029"
lb_protocol = "tcp"
},
{
instance_port = "32030"
instance_protocol = "TCP"
lb_port = "15030"
lb_protocol = "tcp"
},
{
instance_port = "32031"
instance_protocol = "TCP"
lb_port = "15031"
lb_protocol = "tcp"
},
{
instance_port = "32032"
instance_protocol = "TCP"
lb_port = "15032"
lb_protocol = "tcp"
},
{
instance_port = "32400"
instance_protocol = "TCP"
lb_port = "31400"
lb_protocol = "tcp"
},
{
instance_port = "32444"
instance_protocol = "TCP"
lb_port = "15443"
lb_protocol = "tcp"
},
]
module.admin-elb.module.elb.aws_elb.this[0]: Creating...
β·
β Error: creating ELB Classic Load Balancer (p1-cnap-dev-nv-adm-lb): InvalidConfigurationRequest: ELB cannot be attached to multiple subnets in the same AZ.
β status code: 409, request id: 1cc6b458-aa4c-4acb-8b1d-04d965893a55
β
β with module.admin-elb.module.elb.aws_elb.this[0],
β on .terraform/modules/admin-elb/modules/elb/main.tf line 1, in resource "aws_elb" "this":
β 1: resource "aws_elb" "this" {
β
β΅
β·
β Error: creating ELB Classic Load Balancer (p1-cnap-dev-nv-apps-lb): InvalidConfigurationRequest: ELB cannot be attached to multiple subnets in the same AZ.
β status code: 409, request id: a0bbba43-be2a-43fe-a177-4c85e835316b
β
β with module.apps-elb.module.elb.aws_elb.this[0],
β on .terraform/modules/apps-elb/modules/elb/main.tf line 1, in resource "aws_elb" "this":
β 1: resource "aws_elb" "this" {
Would appreciate a lift please. Thanks