From 15433b107b120b3c84f2b08c61a685b2db2be3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Buri?= Date: Wed, 13 Nov 2024 17:19:43 +0100 Subject: [PATCH 1/6] chore: fixes --- variables.tf | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/variables.tf b/variables.tf index d86acfa..a504898 100644 --- a/variables.tf +++ b/variables.tf @@ -1,15 +1,6 @@ -variable "environment" { +variable "domain" { description = < Date: Wed, 13 Nov 2024 17:33:21 +0100 Subject: [PATCH 2/6] Update outputs.tf --- outputs.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/outputs.tf b/outputs.tf index 58903f3..3798427 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,6 +1,6 @@ -output "environment" { - value = var.environment - description = "Environment where this stack has been deployed to." +output "wildcard_certificate_arn" { + description = "The ARN of the certificate" + value = element(concat(aws_acm_certificate_validation.wildcard_cert.*.certificate_arn, aws_acm_certificate.wildcard_cert.*.arn, [""]), 0) } output "region" { From 62bc4e460f3951b585f25d7a65232a92cb489da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Buri?= Date: Wed, 13 Nov 2024 17:34:48 +0100 Subject: [PATCH 3/6] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 22bd746..1b99f45 100644 --- a/main.tf +++ b/main.tf @@ -22,7 +22,7 @@ resource "aws_acm_certificate_validation" "wildcard_cert" { resource "aws_route53_record" "wildcard_cert_validation" { name = tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_name type = tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_type - zone_id = var.should_create_hosted_zone ? aws_route53_zone.hosted_zone.zone_id : aws_route53_zone.this.zone_id + zone_id = var.should_create_hosted_zone ? aws_route53_zone.this.zone_id : aws_route53_zone.this.zone_id records = [ tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_value ] From 4c3faa41236db1f140b41688b25ff9c8ac91b0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Buri?= Date: Wed, 13 Nov 2024 17:36:46 +0100 Subject: [PATCH 4/6] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 1b99f45..7692af6 100644 --- a/main.tf +++ b/main.tf @@ -22,7 +22,7 @@ resource "aws_acm_certificate_validation" "wildcard_cert" { resource "aws_route53_record" "wildcard_cert_validation" { name = tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_name type = tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_type - zone_id = var.should_create_hosted_zone ? aws_route53_zone.this.zone_id : aws_route53_zone.this.zone_id + zone_id = aws_route53_zone.this.zone_id records = [ tolist(aws_acm_certificate.wildcard_cert.domain_validation_options)[0].resource_record_value ] From c1ee52b064e4c9dc89be17d35c27ca2784341661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Buri?= Date: Wed, 13 Nov 2024 17:53:34 +0100 Subject: [PATCH 5/6] Update outputs.tf --- outputs.tf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/outputs.tf b/outputs.tf index 3798427..fd2c52d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -3,6 +3,26 @@ output "wildcard_certificate_arn" { value = element(concat(aws_acm_certificate_validation.wildcard_cert.*.certificate_arn, aws_acm_certificate.wildcard_cert.*.arn, [""]), 0) } +output "hosted_zone_ns_records" { + description = "Name servers of the created hosted zone." + value = aws_route53_zone.this.name_servers +} + +output "hosted_zone_arn" { + description = "The ARN of the hosted zone" + value = aws_route53_zone.this.zone_arn +} + +output "hosted_zone_id" { + description = "The ID of the hosted zone" + value = aws_route53_zone.this.zone_id +} + +output "hosted_zone_name" { + description = "Name of the hosted zone. example.com" + value = aws_route53_zone.this.name +} + output "region" { value = local.region description = "AWS Region code where this stack has been deployed to." From 062a52a92b9f256fbf2bb0d435c29b64d3f74cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Buri?= Date: Wed, 13 Nov 2024 17:56:08 +0100 Subject: [PATCH 6/6] Update outputs.tf --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index fd2c52d..662619e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -10,7 +10,7 @@ output "hosted_zone_ns_records" { output "hosted_zone_arn" { description = "The ARN of the hosted zone" - value = aws_route53_zone.this.zone_arn + value = aws_route53_zone.this.arn } output "hosted_zone_id" {