Skip to content

Commit

Permalink
fix estif
Browse files Browse the repository at this point in the history
  • Loading branch information
jordi.bru committed May 26, 2024
1 parent dae5922 commit 5a1b75a
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
data "aws_route53_zone" "jordibru_cloud" {
name = var.zone_name
}

resource "aws_acm_certificate" "domain_certificate" {
domain_name = var.domain_name
validation_method = "DNS"
@@ -30,14 +34,13 @@ resource "aws_route53_record" "cert_validations" {
records = [each.value.record]
ttl = 60
type = each.value.type
zone_id = aws_route53_zone.hosted_zone.zone_id
zone_id = data.aws_route53_zone.jordibru_cloud.zone_id
}

resource "aws_acm_certificate_validation" "validations" {
count = var.validate_cert ? 1 : 0
certificate_arn = aws_acm_certificate.domain_certificate.arn
validation_record_fqdns = [for record in aws_route53_record.cert_validations : record.fqdn]
#validation_record_fqdns = [for record in var.cert_record : record.fqdn]

provider = aws.us-east-1-acm
}
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -49,8 +49,8 @@ variable "validate_cert" {
default = false
}

variable "zone_id" {
description = "route53 zone id"
variable "zone_name" {
description = "route53 zone name"
type = string
default = ""
default = "jordibru.cloud"
}

0 comments on commit 5a1b75a

Please sign in to comment.