I’m trying to create a beanstalk environment pointing to a shared load balancer, which is a new feature recently announced by AWS.
When I attempt to apply my plan, I get this error:
Error: ConfigurationValidationException: Configuration validation exception: Invalid option value: 'default' (Namespace: 'aws:elbv2:listener:80', OptionName: 'Rules'): The load balancer you specified doesn't have a listener on port 80. Specify listener options only for existing listeners. status code: 400, request id: 287f9ecd-a41c-46f7-8bc2-63394468fe09
It seems terraform is trying to assign the rule for the target group to the default listener, even though I’m attempting to configure it via HTTPS. If I go and create a listener on port 80 on the load balancer, the terraform plan applies and then assigns the listener rule to the listener on port 80. If I remove the port 80 listener, leaving only the port 443 one, I get the error above.
How can I provision a beanstalk environment that correctly references a shared load balancer that is only configured for HTTPS?