I have an Elastic Beanstalk instance with the following .ebextensions
config file to setup a custom load balancer.
Resources:
ApiLoadBalancer:
Type: AWS::ElasticLoadBalancing::LoadBalancer
Properties:
ConnectionSettings:
IdleTimeout: 900
Listeners:
- InstancePort: '80'
InstanceProtocol: 'HTTP'
LoadBalancerPort: '443'
Protocol: 'HTTPS'
SSLCertificateId: 'certificate-id'
HealthCheck:
HealthyThreshold: '3'
Interval: '30'
Target: 'HTTP:80/api/healthcheck'
Timeout: '5'
UnhealthyThreshold: '5'
AvailabilityZones:
- "us-east-1a"
However, whenever the beanstalk environment is rebuilt, my custom load balancer is created as defined, however the EC2 instances themselves are not attached to it.
How do I get the instances to use my custom load balancer?