Skip to content

Commit

Permalink
Changed file names, added name as output
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfox675 committed Apr 21, 2021
1 parent b1938f4 commit 367ea64
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 25 deletions.
29 changes: 29 additions & 0 deletions kms.tf → main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
resource "aws_route53_zone" "this" {
name = var.domain_name
}

resource "aws_route53_key_signing_key" "this" {
count = var.dnssec == true ? 1 : 0
hosted_zone_id = aws_route53_zone.this.id
key_management_service_arn = aws_kms_key.this[0].arn
name = var.signing_key_name
}

resource "aws_route53_hosted_zone_dnssec" "this" {
count = var.dnssec == true ? 1 : 0
hosted_zone_id = aws_route53_key_signing_key.this[0].hosted_zone_id
}

resource "aws_route53_record" "this" {
count = var.dnssec == true ? 1 : 0
zone_id = aws_route53_zone.this.zone_id
name = "@.${aws_route53_zone.this.name}"
type = "DS"
ttl = var.ttl

records = [aws_route53_key_signing_key.this[0].ds_record]
}

#######
# KMS
#######
resource "aws_kms_key" "this" {
count = var.dnssec == true ? 1 : 0
description = "Used to sign dnssec records"
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
output "zone_id" {
value = aws_route53_zone.this.zone_id
}

output "name_servers" {
value = aws_route53_zone.this.name_servers
}

output "name" {
value = aws_route53_zone.this.name
}
25 changes: 0 additions & 25 deletions r53.tf

This file was deleted.

0 comments on commit 367ea64

Please sign in to comment.