12
votes

I have created a new Elastic Beanstalk application on AWS. I have to use a CNAME to redirect traffic to the end point of the Elastic Load Balancer through a DNS managed by Network Solutions, and they have size restrictions on the length of the CNAME target. It would appear that Elastic Beanstalk chooses very large random names for their load balancers.

  1. Is there a way to rename a load balancer?
  2. Is there a way to specify the load balancer name at Elastic Beanstalk initialization?
  3. If I just create a new load balancer is there a way to add it to my Elastic Beanstalk environment?
2
To echo the question made in @Yurinator's answer: why do you have to redirect traffic to the ELB address rather than the .elasticbeanstalk.com address?Philip Kendall
Because CNAMEs are visible to the client and require a second lookup — setting your ELB as the "alias" means its IP will be the A record and persist through ELB/Beanstalk changesTom McKenzie

2 Answers

5
votes

Unfortunately the answer is no to the first 2.

The last one, you are able to do it, but it more or less goes against the flow of Elastic beanstalk. You would need to create your own ELB with whatever name you like and then put it in front ot the instance that is created by beanstalk. You would need need to delete the ELB that beanstalk created so that it's not sitting there costing you money.

I can't remember if beanstalk boots its environments via an AutoScaling group, but if it does, you'll need to associate that AutoScaling group with your new ELB.

After creating and syncing all of that up, you need to point your CNAME to your new custom made ELB.

That should work.

-1
votes

You can rather create CNAME for your custom domain to elastic beanstalk DNS. Something like:

www.my-custom-domain.com CNAME to my-stalk-name.elasticbeanstalk.com

That way your are not relying on auto-generated ELB name. You bean stalk name is defined by you and not going to change.