How to delete CNAMEs mappings created in AWS Elastic Beanstalk - amazon-web-services

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!

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.

Related

Route53 DNS issue with Django Elastic Beanstalk app

Not sure what I am doing wrong here. My zone is public and I have simple routing for the A records pointing to the EB alias. I even tried a CNAME to no avail.
Browser error in Chrome -- The site can't be reached. DNS address could not be found. Diagnosing the problem. DNS_PROBE_POSSIBLE
I even did a test response within the console. Everything checks out but there is something funny happening between the Route53 -> EB handshake. The EB alias works just fine by itself.
I would love some pointers. Perhaps I need to configure something within Django settings?
It turned out to be an issue with the resolvers on the AWS side even though I didn't transfer the domain. They provisioned the wrong resolvers and I had to manually change them out to a different set. I only discovered this fact after creating a support case.

How do I make sure my DNS and domain routing is done properly on Route 53?

I recently created a new domain on GoDaddy to which I want to move my current website.
I decided to move the hosting to AWS and create an EC2 Instance there.
Everything was going fine until I purchased the new domain I want to move my website to and started configuring Route 53.
I ended up following a tutorial that said to move the GoDaddy records to Route53 where I had created a hosted zone, so i started doing exactly that. However, the A record pointed to "parked", the 'www' cname record pointed to # and a '_domainconnect' cname record pointed to _domainconnect.gd.domaincontrol.com'
When creating the new records on Route 53, I changed the 'www' cname record by making it point to my domain 'example.com' so that the www.example.com points to example.com.
I changed the A record so that it points to the IPv4 address on my instance.
Finally, I did not copy the "_domainconnect' record because I thought this was something that had to do with GoDaddy specifically and probably shouldn't be copied (I also did not see it in any tutorial).
Now, there was no problem accessing the website through the www.example.com or example.com domains but after reading multiple tutorials and watching multiple videos, there are 2 things I want to make sure I am doing right:
1- Somebody mentioned the server serving www.example.com and example.com twice and them being 2 separate versions when the previous process is done... I didn't understand what they meant and if this was a problem or not. If someone could clarify this, that would be awesome.
2- Somebody also mentioned using Elastic IPs for Route53 because the instance IPv4 might change? Is that something I should be worrying about if I will be running a website on the instance?
Sorry for the long explanation, I am trying to be as descriptive as possible.
This is the Route 53 Configuration:
To better understand point one, if you could attach the route 53 configuration the could hep us giving a better answer.
For the second point, two recommendations.
it is better if you create an Elastic IP and attach to a network interface, then attach the network interface to the instance. In this way the IP would stay forever (or as long as you want). Otherwise, as soon as you restart the instance, and this can definitively happen, you will loose the IP, therefore your DNS needs to be propagated again.
leave everything as it is, but as a further step learn what an AWS VPC is, it will give you much benefit rather than exposing your instance directly to the internet.

Google Domain and G-Suite with AWS instance

I have been looking around the internet and I have come across a few different ways to link my AWS EC2 instance to my domain name. It looks like I could do it using Route 53 but I am not entirely sure on that process. The other way is to map it from google. These seem like the best instructions I have found for that: link a Google Domain to Amazon ec2 server
The question that I can not seem to find is what about my email address. I pay google so that I can have some email addresses name#mydomain.com. Now these work fine and I have had them up and running for months. But now I want to have my website (it is a web app) point to it. Because currently when you go to mydomain.com it says This site can’t be reached mydomain.com’s server IP address could not be found.
Some help here on how to do this would be great. I am afraid that I am going to set this up incorrectly and then lose access to my gmail account which I cannot have happen.
Your domain's email is configured via MX DNS records. You would point your domain to your EC2 instance by adding A or CNAME DNS records. The two configurations are completely separate. You will not break your current email setup by adding an A or CNAME record that points to the EC2 instance. You simply need to add that record in your DNS settings, wherever your DNS is currently hosted. You don't need to make any changes in your Gmail account configuration, and you don't really need to use Route53 either (although it does add some nice features). You had to configure the MX records somewhere at some point, to setup your G-Suite account for your domain. You just need to go into that same DNS configuration (most likely still hosted at the company where you initially purchased the domain name) and add an additional record.

Pointing sub domain only to AWS EC2 instance?

I am trying to migrate a PHP site to AWS.
I have created an instance with a specific AWS url and have configured an AWS Route 53 service.
Looking at the docs here: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-update-ns-record
It says to update the Nameservers for the particular domain, however that would affect the live version of the site which is still being hosted on Digital Ocean.
What I want to do is:
Point a subdomain e.g. dev.mysite.com to the dev environment on AWS
Check everything is ok
Create a live environment on AWS
Point mysite.com to the live environment.
I am still new to this way of hosting, is what I am trying to achieve, feasible.
Or is there another way I should be tackling this.
Any suggestions welcome.
Thanks
That's absolutely fine. Within Route 53, you can create an a record for your Apex (www.site.com) to point to your EC2 (?) instance, and then another CNAME record which points to your dev.site.com
Note that Alias records are free, and the preferred way of doing the above, but only work with certain types of AWS resources such as ELBs.

Custom URL in AWS Elastic Beanstalk

AWS Elastic Beanstalk suggests using a URL in the following format: https://{appname}.elasticbeanstalk.com/
But I need to change it to my own URL, something like https://tarta.ai
How to do it?
Note: I use Amazon Route53 for my domain.
I know this is old question but since I just done this process for one of my apps, I decided to share it here which may help others too. Here's the steps I've gone through
Login to your AWS Account
Go to your EC2 Panel and select your region
Select Load Balancer from left navigation menu
Found Load Balancer which related to your Beanstalk App
In Description Tab grab Hosted Zone ID
Open Route53 Panel
Select your domain hosted zone
Add A Record for .example.com
Select Alias option to Yes
Search for your Load Balancer related to you app
Confirm it's Hosted Zone ID with what you grabbed in step 5
Do steps 8-11 for www.example.com as well.
References
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html
http://aws.typepad.com/aws/2011/05/moving-ahead-with-amazon-route-53.html
Use Amazon Route53. ELBs, including those generated with ElasticBeanstalk, are assigned CNAMEs. You can't just point your top-level domain at a CNAME, as it violates the RFC. You could point a CNAME record like http://www.example.com at it, but that still won't respond at http://example.com. It's an irritating problem; for example, consider this 7-page thread on the AWS forum.
The easiest solution is Route53. It uses special apex records to map TLDs to ELBs, thus avoiding the problem entirely. You can also use an EIP'd public instance to forward traffic to the ELB, although this raises scalability concerns.