Tiago Peres
Tiago Peres

Reputation: 15421

External subdomain pointing to Elastic Beanstalk environment

In this particular case, I have a domain in a different provider (other than AWS) and an Elastic Beanstalk (EB) application with multiple environments that each use different resources.

From the domain provider, I've created a subdomain named - test.tiagoperes.eu.

What I want is that by going to this subdomain, any user would see what's currently found in the EB environment named production which is currently accessed in (app-prod is not the real name but follows a similar pattern)

app-prod.eba-xepr49ar.us-east-1.elasticbeanstalk.com

This is an environment with Auto Scaling Group, Target Group and Load Balancer.

What must be done?


Note: There's a similar question but it is very general (hence the variety of answers). Also, there's this question used in a basic EB environment. Also, I've looked at this guide.

Upvotes: 0

Views: 1650

Answers (1)

Marcin
Marcin

Reputation: 238051

Based on the comments.

The OP uses external DNS provider (not AWS Route53). Thus, CNAME record, or equivalent in the external provider, should be created for the subdomain. The record should resolve to the default name of on ElasticBeanstaslk.

Since the DNS provider is external to AWS, there is no need to do anything at the AWS.

In more detail, in the DNS manager of the domain, create a CNAME record for the subdomain. For example, if the EB subdomain is: app-prod.eba-xepr49ar.us-east-1.elasticbeanstalk.com then we should have a CNAME entry for app-prod.eba-xepr49ar.us-east-1.elasticbeanstalk.com. According to Mark B

We should never be pointing directly to a server/IP address with Elastic Beanstalk (EB), it should always be using the DNS endpoint Elastic Beanstalk provides.

Depending on the DNS host we are using, one can add the CNAME record ourselves, or we may need the host to add it for us. As examples, how to do it in Namecheap and GoDaddy is explained in their docs:

Upvotes: 3

Related Questions