Andrew D
Andrew D

Reputation: 25

AWS: Pointing sub-domains to different elastic beanstalk environments

Using Amazon AWS, I have two Elastic Beanstalk environments. One hosts my React client, and the other hosts a Node.js API for the client.

I own some-domain-name.com and I would like to use two sub-domains:

I would like app.some-domain-name.com to point to the React environment, and api.some-domain-name.com to point to the API environment.

Is there a great way to do this using Route 53 and hosted zones? In the past, I've rerouted traffic on different sub-domains to different ports on the same server. I have not, however, been able to route requests to different servers depending on the sub-domain. Thanks!

Upvotes: 2

Views: 904

Answers (2)

Adem Tepe
Adem Tepe

Reputation: 778

Actually yes, there is a great / easy way to do it:

Route 53 Dashboard > Hosted zones > your domain > Create record > Define simple record:

enter image description here

You are good to go after you enter your subdomain and choose the environment.

I'm actively using this configuration.

Upvotes: 0

Mark B
Mark B

Reputation: 201118

Just create 2 CNAME records in whatever DNS host you are using, one for each subdomain. This is the most basic way of using DNS, so any DNS host will support this, no need for Route53 unless you are already using it.

Upvotes: 1

Related Questions