Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Terraform 1.0 / AWS 3.39+ #3

Open
jonnyzzz opened this issue Jul 14, 2021 · 0 comments
Open

Migrate to Terraform 1.0 / AWS 3.39+ #3

jonnyzzz opened this issue Jul 14, 2021 · 0 comments

Comments

@jonnyzzz
Copy link

jonnyzzz commented Jul 14, 2021

This is a helpful module. Would be nice to have it migrated to the actual Terraform/AWS plugin.

It uses a slightly different syntax, e.g.:

resource "aws_acm_certificate" "api" {
  domain_name               = var.public_dns
  subject_alternative_names = []
  validation_method         = "DNS"

  tags = {
    Name    = "${local.prefix}"
    stack = local.stack
  }

  provider = aws.api_gateway
}

resource "aws_route53_record" "proof" {
  for_each = {
    for dvo in aws_acm_certificate.api.domain_validation_options : dvo.domain_name => {
      name   = dvo.resource_record_name
      record = dvo.resource_record_value
      type   = dvo.resource_record_type
    }
  }

  allow_overwrite = true
  name            = each.value.name
  records         = [each.value.record]
  ttl             = 60
  type            = each.value.type
  zone_id         = data.aws_route53_zone.api.zone_id
}

resource "aws_acm_certificate_validation" "api" {
  certificate_arn         = aws_acm_certificate.api.arn
  validation_record_fqdns =  [for record in aws_route53_record.proof : record.fqdn]
  provider = aws.api_gateway
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant