1
votes

I create some test Elastic Beanstalk app using the EB CLI, like:

eb create [...]

and, in the process, I get asked the question about the CNAME prefix:

[...]
Enter DNS CNAME prefix
(default is bla): staging-server
[...]

And everything goes ok. But then, I want to test another option (i.e. add a ELB in the Elastic Beanstalk app) and for this I terminate the previous Application. The I create a new one. When reaching the DNS CNAME prefix question, I get:

[...]
Enter DNS CNAME prefix
(default is bla): staging-server
That cname is not available. Please choose another.
[...]

So, it is not allowing me to reuse the CNAME despite the fact the app was destroyed. So I need to "invent" another one, for example, staging-srv

Now, the problem is that I have made multiple tests and I have "excluded" one by one, all the sensible names I could think of.

I'd like to be able to delete them so that I can reuse them.

Not to mention that I'd really like to be able to clean after me and not to leave these cnames hanging in the ether, as even in the Amazon docs it's indicated:

Important If you terminate an environment, you must also delete any CNAME mappings you created, as other customers can reuse an available hostname. (see first red-ish box in https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html )

But how to do this, is not mentioned anywhere... I am not using Amazon's DNS server (Route 53) at all, therefore there is no domain there in which these CNAMEs should be listed.

Where are these CNAME mappings and how can I delete them so that I can create them again?

Thanks in advance!

1

1 Answers

0
votes

The section you are referring to is about custom domains that you fully own.

When you terminate your environment, the staging-server name should be fried. It is done by AWS and you have no control over it, as they are managing the region.elasticbeanstalk.com domain.

I verified the automatic deletion of the CNAME on my own EB environments, and it does work. However, since its managed by AWS there maybe some delay in when they actually delete the CNAME.

There could be other reasons why the CNAME is still there. Your environment may have failed to be terminated. You can double check in EB console if its really gone.