0

I'm trying to deploy AWS CloudFront distribution in eu-central-1 that will have a custom certificate set. Here's the relevant code excerpt:

data "aws_acm_certificate" "my_cert" {
  domain   = "*.example.com"
  statuses = ["ISSUED"]
}

resource "aws_cloudfront_distribution" "static_content" {
  origin {
    domain_name = aws_s3_bucket.test.bucket_domain_name
    origin_id   = local.s3_origin_id
  }

  viewer_certificate {
    acm_certificate_arn = data.aws_acm_certificate.my_cert.arn
  }

  ...
}

The terraform doc says:

acm_certificate_arn - The ARN of the AWS Certificate Manager certificate that you wish to use with this distribution. Specify this, cloudfront_default_certificate, or iam_certificate_id. The ACM certificate must be in US-EAST-1.

In the AWS Console I can see the certificate ARN contains us-east-1 in it. But when I debug the data.aws_acm_certificate.my_cert the ARN contains eu-central-1.

Is there a way how to get the ARN of the us-east-1 cert while deploying CloudFront anywhere else?

Ikar Pohorský
  • 4,617
  • 6
  • 39
  • 56

0 Answers0