1

I have an EC2 instance running my Web Application with and Elastic IP. I use CloudFlare's basic CDN and GoDaddy is the domain registrar. So, the nameservers at Godaddy are those of CloudFlare and the IP at cloudflare is the Elastic IP assigned to the instance.

I have just finished adding an Application Load Balancer. The steps that I took, were: 1. Created a Load Balancer 2. Created a Launch Configuration 3. Created an Auto Scaling Group with Minimum 2 and Maximum 100 instances, with alarms to increase and decrease when CPU average utilization increases/decreases. 4. I DID NOT add any instance while creating the Load Balancer 5. I had created an AMI for my EC2 instance and used that while setting up the Launch Configuration.

I can access the Web Application from the DNS of the Load Balancer. How do I tell the domain to use the Load Balancer and instances started by it? I do not use Route53 and have configured the Apache VirtualHost manually.

gentrobot
  • 169
  • 2
  • 10

1 Answers1

1

Ideally you want to use Route 53 and add an alias record. It'll cost you $0.50 per month plus $0.40 per million DNS queries. Maybe $1 a month, probably less.

However CloudFlare have an article on how to use ELB with their DNS. You have to do it this way because you need to use a CNAME to point at the ELB domain name, as ELB doesn't have a fixed IP address, and you can't typically put a CNAME at the domain apex.

I found this with the Google search "use elb with cloudflare dns", so you can probably find other resources if required.

Tim
  • 30,383
  • 6
  • 47
  • 77
  • Thanks for your reply. I did figure it out, after I posted the reply. I have created a CNAME www that points to the DNS for the Load Balancer. Though, I am still confused about how to push code changes, that get reflected on the Load Balancer instances? I make changes to the code on my instance that earlier hosted the application (it still does and the domain points to this IP only), but this code is not visible on the Load Balanced instances. – gentrobot Sep 08 '16 at 10:11
  • Could be caching on CloudFlare. Load Balancers don't cache, so it's not that. Try connecting to your instance manually / directly (eg curl from the instance) and see what happens. You can flush the CF cache from their control panel. – Tim Sep 08 '16 at 19:33