Menu

1 / 2

Provision DNS records with Terraform

DEV Community·Viktor Vasylkovskyi·6 months ago
#zNzhotyZ
#adding#aws#devops#networking#records
Reading 0:00
15s threshold

Previous: Deploying EC2 instance with Terraform

In the previous notes we talked about how to setup the ec2 instance inside of the VPC on the subnet. We managed to access to this instance via SSH by providing ssh key in security groups. If you haven't read about it, fear not, you can still go back and read it: Deploying EC2 instance on AWS with Terraform .

All is fine and dandy until now, but when we want to run a real application, we want to expose it on HTTP (and later HTTPS). In this note, I will walk you through how to do it using terraform. In practice, we will spawn a simple http server on our ec2 instance, and provide Route53 DNS records (diagram below).

When adding DNS, we will be able to access our application not via IP address like

http://52.206.93.210/

Enter fullscreen mode

Exit fullscreen mode

but via actual domain that you own like

http://www.your-domain.com

Enter fullscreen mode

Exit fullscreen mode

Let's dive in!

Github Repository

This guide full code is available in…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.