From 3b2c4ca4d77fd4bae862a200f8b4f2ca5e4e8043 Mon Sep 17 00:00:00 2001 From: Akash Agrawal Date: Wed, 14 Sep 2022 13:13:02 +0530 Subject: [PATCH] DOPS-101 Add route 53 resource --- packer/machines/web-server.json | 2 +- terraform/route53.tf | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packer/machines/web-server.json b/packer/machines/web-server.json index 92e678a..ec2fc20 100644 --- a/packer/machines/web-server.json +++ b/packer/machines/web-server.json @@ -19,7 +19,7 @@ "ssh_username": "centos", "ami_name": "devops-infra-demo-centos-7-{{timestamp}}", "ami_description": "DevOps Infrastructure Demo CentOS 7 - CIS hardened", - "ami_users": ["587267277416"] // Share with devops sandbox account + "ami_users": ["587267277416"] }], "provisioners": [ { diff --git a/terraform/route53.tf b/terraform/route53.tf index 6f5393e..b9caace 100644 --- a/terraform/route53.tf +++ b/terraform/route53.tf @@ -1,10 +1,10 @@ -data "aws_route53_zone" "dev" { - name = "${var.domain}." +resource "aws_route53_zone" "dev" { + name = "${var.host}.${var.domain}" } resource "aws_route53_record" "main" { - zone_id = "${data.aws_route53_zone.dev.zone_id}" - name = "${var.host}.${var.domain}" + zone_id = "${aws_route53_zone.dev.zone_id}" + name = "${aws_route53_zone.dev.name}" type = "CNAME" ttl = "300" @@ -14,5 +14,5 @@ resource "aws_route53_record" "main" { } output "route53-dns" { - value = "${var.host}.${var.domain}" + value = "${aws_route53_zone.dev.name}" }