ANT
ANT

Reputation: 87

DevOps, DNS and Public IP

I have a devops automation environment. Each successful build (web app) in Jenkins triggers a creation of EC2 (Linux) instance in AWS which is set to receive public IP and the app gets deployed on that instance. I'm calling the web application using instance's public IP. I need to mask the IP and call the app by custom name. I have created a subdomain on Route 53 subdomain.abc.com. I have three set of web apps and want to call them like one.subdomain.abc.com, two.subdomain.abc.com etc.

Since each time we have a different VM I'm not sure if EIP is an option. Can someone please suggest a solution ?

Many thanks in advance.

Upvotes: 2

Views: 166

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270104

If you are using just one Amazon EC2 instance for each app, then for each app you can:

  1. Create an Elastic IP address that will be permanently used with the app
  2. Create an A record in Amazon Route 53 to point to that Elastic IP address (eg app1.example.com)
  3. When a new instance of the app is launched, re-associate the Elastic IP address with the new instance (assuming your old instance is then terminated)

If you wish to serve traffic from app1.example.com to several Amazon EC2 instances, then create an ALIAS record in Route 53 to point to an Elastic Load Balancer and register the EC2 instances with the load balancer.

Upvotes: 1

Related Questions