Moving from digitalocean to aws - amazon-web-services

I am carrying a web site from digital ocean to aws. evertyhing was good until DNS update.
I want to update 'A' record on digital ocean to point to my aws elastic load balancer.
But A record only accepts IP address and AWS elastic load balancer ip address is not static. but hostname is.
Another option is to carry nameserver from digital ocean to AWS directly but given name server update time is undeterministic i don't want this. this is a live website and during this time new data will be produced on the old web site.
Any recommendations?

Based on the comments.
Since DigitalOcean does not support alias records, you can't use CNAME for naked domains.
But, you could get static public IP for your EB, if you either change your load balanced environment to single instance. Each single instance environment has static IP through elastic IP. Other way is to change your application load balancer to network load balancer, if possible. NLB has public static IPs, which you could use for the A record.

Related

Configure third party DNS to Static Public Ip attached to AWS ElasticBeanStalk

First of all, I am a beginner in this fields, so apologies If my questions is stupid or just too easy.
What do we want to configure? Well, we have a partnership with a website wwww.partner.com.
We have an application running on elastic beanstalk with an application load balancer. And we need to provide to our partner a STATIC IP for the to link wwww.partner.com/ourcarpet to it.
To sum up, we want this architecture:
DNS - www.partner.com/ourcarpet -------> OUR STATIC IP IN AWS
STATIC IP IN AWS -----> NLB --> EB
I created a Network Load Balancer, and attract to it a STATIC IP. What I do not know is how to access this IP through HTTPS.
Am I using the correct approach? Can I link my Statis IP to a CNAME or A in a DNS outside of AWS?
The "/ourcarpet" part of the URL is not visible for DNS.
The IP and other records can be set only for subdomain/domain names.
In that case www.partner.com/ourcarpet should be redirected to ourcarpet.partner.com (or another domain you control), so you can set the required IP.

Route53 - DNS resolution to a specific port on an EC2 instance

I have a website that I have hosted on an EC2 instance that runs on port 3000. (e.g. 3.27.83.19:3000 - assuming the IP address of the EC2 instance is 3.27.83.19)
I have a domain that I have already bought mydomain.com through AWS that I already see in Hosted Zones.
How can I set-up Route53 so that when someone hits "mydomain.com", it takes them to 3.27.83.19:3000 rather than 3.27.83.19
Thanks!
point domain to instance ip
To point example.com to 3.27.83.19 you simply need to create an A record in route53
point domain to load balancer
To access the website running port 3000 on an EC2 instance through https://example.com, you need a service that accepts traffic on https://example.com and then forward the traffic to the EC2 instance on port 3000. You can easily do it with an AWS application load balancer. I like this approach.
There are many benefits using an application load balancer. The important one is that you can configure the SSL certificate easily. The application load balancer also supports host based routing which allows you to host multiple websites.
If you are looking for less expensive solutions, you can also go for setting up an nginx proxy inside the ec2 instance. I personally don't like this approach because you will need to configure SSL at the application level.
https://aws.amazon.com/premiumsupport/knowledge-center/public-load-balancer-private-ec2/
Hope this helps.

Using an elastic IP with an AWS Load Balancer

It sounds like I cannot use an elastic ip with AWS Application Load Balancer.
I currently own a domain through GoDaddy and the DNS server points to the load balancer via the CNAME. However, if the load balancer dies and gets recreated, its url changes and I then have to change the CNAME and wait for the change to propagate.
There must be a solution around this - what is it?
It looks like the solution might be to use two load balancers - https://aws.amazon.com/blogs/networking-and-content-delivery/using-static-ip-addresses-for-application-load-balancers/, but this seems really excessive - I have a small application right now.
As far as I know, the only way to have a fixed static-IP for a LB is to use a Network Load Balancer.
As stated here
Support for static IP addresses for the load balancer. You can also assign one Elastic IP address per subnet enabled for the load balancer.
An Elastic Load Balancer retains its DNS name as long as you don't replace it manually. If you still want to have a temporary, low-cost solution to this problem, you can consider the following approach:
Assuming the application is deployed in a private subnet, I would proxy the traffic through an EC2 instance until your primary DNS changes propagate.
Launch a small EC2 instance and attach an Elastic IP to it (consider your bandwidth requirements to determine which size).
Configure a proxy (nginx) to forward traffic to your application.
Configure active-passive DNS failover using ELB DNS name and EIP.

AWS - Link IP to domain

I have created a wordpress EC2 instance, but every time I restart the IP gets changed so I have to develop site on a new IP which is very inefficient.
My questions are:
Is there IP or something which is fixed so that I don't have to develop wordpress website in different IP every time. Since I am researching here free option is preferred?
Let's say once my website is complete, how can I point this IP to my domain?
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html -> you can use an elastic IP address and then reference that IP in your DNS. Costing for elastic IPs: https://aws.amazon.com/ec2/pricing/on-demand/#Elastic_IP_Addresses - in summary, in certain conditions an elastic IP is free.
Or you could put your EC2 behind a loadbalancer and then reference the load balancers DNS name (ie cname your web address to the load balancers DNS address). You probably want to use the Application Load Balancer. https://aws.amazon.com/elasticloadbalancing/ - this is not free but does present certain advantages over directly referencing the public IP in DNS.

Getting root to point to AWS ELB without using AWS nameservers

I've set up my application on AWS Elastic Beanstalk. I added a load balancer and pointed a CNAME for 'www' to it. But now I need to get root pointed there too. I can't use Route53 and use AWS nameservers because the client wants to use theirs. How can I get root to my app? Can I redirect the traffic? The tech lead I'm working with suggested setting up a server to do the redirect?
Since AWS ELB's only offer DNS Record (Instead of IPs) you need to use a CNAME mapping. However with DNS, CNAMEs do not allow root domain to point to it. To overcome this AWS has provided Alias Records (Custom implementation to AWS) to point root domain to ELBs.
If your client want to use their nameservers still you can use, AWS Route53 in between to solve this with following steps.
First create a Public Hosted Zone in Route53 for your domain.
Then create a record set inside the Hosted Zone for the root domain to point to the ELB with Type = A - IPv4 Address, Alias = Yes with ELB CNAME as for the Alias value.
In the external domain management service, create a NS record to point the root domain to Route53 nameservers.
Then when the DNS resolution happens, the root DNS query will first go to external nameservers(Managed outside of Route53) and then it will be forwarded to route53 where it will resolve the ELBs IP address and sent back.
You can set up a machine with a single static IP address that does nothing but redirect requests to the www host. Then you can put an A record on the bare domain at the apex of the DNS zone pointing to that machine.
There is at least one service, http://wwwizer.com/naked-domain-redirect, that will do this for you. (I'm not affiliated with this service, but it appears to do what it claims and will serve your purpose. There are probably others like it.)
Ideally, though, you'd persuade your client to change the authoritative nameservers to point to a Route 53 hosted zone that you create for them. They are still the registrant and "owner" of their domain, and can take control back from you by simply changing the nameservers to something else.
I generally persuade clients with the explanation that our load balancer infrastructure is integrated with the DNS servers so that if a balancer node fails, or we need to add or scale up capacity, or experience a traffic surge or DDoS event, the load balancer system will automatically update the DNS records for their domain to try to mitigate the issue and keep the site up. To do otherwise is to do things in such a way that removes those layers of redundancy.
Ideally, you can set up a apache server with a static IP, and install a free SSL certificate on that web server at first.
Second you need to redirect your root domain name request to AWS ELB.
Then go to your DNS management and set up your apex point to the server you created.
It is now possible to setup a Network Load Balancer and allocate one or more Elastic IP Addresses to it (one per Availability Zone). The Network Load Balancer can have an Application Load Balancer as a target. The Application Load Balancer would target the Elastic Beanstalk. An A record can then be created in the external DNS for each Elastic IP Address of the Network Load Balancer.
If you don't need the functionality that the Application Load Balancer provides, you may be able to target Elastic Beanstalk or whatever application directly from the Network Load Balancer.
Since AWS ELB's only offer DNS Record (Instead of IPs) you need to use a CNAME mapping. However with DNS, CNAMEs do not allow root domain to point to it. To overcome this AWS has provided Alias Records (Custom implementation to AWS) to point root domain to ELBs.
If your client want to use their nameservers still you can use, AWS Route53 in between to solve this with following steps.
First create a Public Hosted Zone in Route53 for your domain.
Then create a record set inside the Hosted Zone for the root domain to point to the ELB with Type = A - IPv4 Address, Alias = Yes with ELB CNAME as for the Alias value.