diff --git a/main.tf b/main.tf index 22bd746..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.hosted_zone.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 ] diff --git a/outputs.tf b/outputs.tf index 58903f3..662619e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,6 +1,26 @@ -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 "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.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" { 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 = <