I can't seem to create a AWS ELB..
0.7.5
aws_elb
resource "aws_elb" "management-ldap" {
name = "core-management-ldap"
availability_zones = ["${data.aws_availability_zones.available.names}"]
security_groups = ["${aws_security_group.management-slaves-ldap.id}"]
instances = ["${aws_instance.management-slave-ldap.id}"]
access_logs {
bucket = "mylogs"
bucket_prefix = "loadbalancers"
interval = 60
}
listener {
instance_port = 389
instance_protocol = "TCP"
lb_port = 389
lb_protocol = "TCP"
}
listener {
instance_port = 636
instance_protocol = "TCP"
lb_port = 636
lb_protocol = "TCP"
}
tags {
Name = "core-management-ldap"
environment = "core"
service = "management"
}
}
* aws_elb.management-ldap: ValidationError: EC2-Classic load balancer port must be either 25, 80, 443, 465, 587 or 1024~65535 inclusive
status code: 400, request id: 8d70ef50-97a7-11e6-adc5-13d61f2dba31
Not running EC2 Classic.
ELB should have been created.
It wasn't.
terraform apply
Instead of giving it availability zones, you should give it subnets within your VPC.
Something like...
subnets = ["${var.my_public_subnets}"]
Hey @FransUrbo – like @nwalke mentioned, please use subnets to designate your ELB into a VPC. By specifying your availability zones, AWS is trying to place this ELB into a Classic env
Please reopen this, remove the 'bug' keyword and add a 'documentation' instead.
It's not obvious that adding the availability_zone makes it a EC2 Classic. Only that it's required _for_ a EC2 Classic.
https://www.terraform.io/docs/providers/aws/r/elb.html#availability_zones
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.
Most helpful comment
Instead of giving it availability zones, you should give it subnets within your VPC.
Something like...