0

I have set ALB with fargate, currently I can access to ALB with dns name like this

myapp-LoadB-FDEWFSOAQXD4-f18c75dd4249a10d.elb.ap-northeast-1.amazonaws.com

However it is said this DNS could be changed.

So I want to give this the Elastic IP

I have experienced connection EC2 and Elastic IP.

In Elasitc IP panel I can choose instance.

However, there is not ALB is listed.

How can I set Elastic IP to ALB ? or am I wrong basically?

whitebear
  • 11,200
  • 24
  • 114
  • 237

2 Answers2

2

If you wish to create a 'friendly' name for an Application Load Balancer, you can create a CNAME record in your Domain and point it to the DNS Name of the Load Balancer.

If you wish to point the Apex of your domain (eg example.com), you can use an Alias in Amazon Route 53 to point to the Application Load Balancer. (It is not normally possible to point a Domain apex to a CNAME record, so the Alias capability of Route 53 will do it for you.)

See: Routing traffic to an ELB load balancer - Amazon Route 53

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thank you for comment, At first I thought the DNS might be change, but it was wrong. I just use CNAME in my Domain for friendly name – whitebear Feb 04 '22 at 14:59
2

Two options here, depending on what kind of direction you are heading:

If you do not like the default DNS name

You can create a DNS record that will point to your load balancer. This means that people would be able to surf to your website by using www.whitebear.com instead of myapp-LoadB-FDEWFSOAQXD4-f18c75dd4249a10d.elb.ap-northeast-1.amazonaws.com

See: Routing traffic to an ELB load balancer - Amazon Route 53

If you really want to attach an ElasticIp to a loadbalancer

There are some use cases where it is really needed to be able to surf to a loadbalancer using a fixed IP. You can achieve this by setting up a Global Accelerator on AWS.

With Global Accelerator, you are provided two global static public IPs that act as a fixed entry point to your application, improving availability.

More information can be found on the AWS Global Accelerator page

ThomasVdBerge
  • 7,483
  • 4
  • 44
  • 62
  • Thank you for comment, I was afraid of DNS might change. but now I understood. it continues. So I will use CNAME in my domain setting – whitebear Feb 04 '22 at 15:00