简体   繁体   中英

I created an ECS container, how can I bind a domain to it?

I created an ECS container, how can I bind a domain to it? I can't find a single guide. It's Complicated. VPC, MVP DDFDF DDH FDFD DQPQ, and other nonsense. Can't Amazon JUST bind a domain to a CONTAINER so that my site works and I show it to a client? Help me please.

UPD:

now i have this architecture:

在此处输入图像描述

UPD2: use https://aws.amazon.com/elasticbeanstalk/?nc1=h_ls

To have a domain resolve to your container it needs a record value that can be assigned.

  • If the container is running behind a load balancer you would use the load balancers CNAME.
  • If the container is a standalone container (no others), this will depend based on your network mode for ECS. It will either use the EC2 IP address, or will attach it's own ENI granting it its own IP (this is retrievable from the console when looking at the task).

The suggested approach would be to use a load balancer as the CNAME will not change, whereas a host failure may cause an ECS containers public IP address to change (or even rolling out a new task definition).

You will take this value and add it as your domains value.

If you're using Route 53:

  • Use an A record with Alias value as the load balancer if you're using a load balancer.
  • Use an A record of an IP if using a host/container IP

If you're using an external provide:

  • Use a CNAME record with the value of the loadbalancer CNAME if you're using a load balancer.
  • Use an A record of an IP if using a host/container IP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM