-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
creating CloudFront Distribution: InvalidViewerCertificate: The specified SSL certificate doesn't exist, isn't in us-east-1 region, isn't valid, or doesn't include a valid certificate chain #55
Comments
I tried to reissue cert, also tried to generate cert via terraform but hit some other bug: Still, when I review the cloudfront config, it points to correct ARN in virginia region, but while using eu-west-1 region for cloudfront deploy and use this us-east-1 arn, it fails.....
|
Must use us-east-1 for your Certs (certificate manager). |
CloudFront certs must be created in the |
I'm running into a similar issue. I'm using this module to create a static website. This is (an excerpt of) the configuration I have: resource aws_route53_zone "default" {
name = var.domain_name
tags = local.tags
}
module "acm_request_certificate" {
source = "git::https://github.com/cloudposse/terraform-aws-acm-request-certificate.git?ref=tags/0.7.0"
depends_on = [aws_route53_zone.default]
domain_name = var.domain_name
process_domain_validation_options = true
subject_alternative_names = ["*.${var.domain_name}"]
wait_for_certificate_issued = var.wait_for_certificate_issued
zone_name = var.domain_name
tags = local.tags
}
module "cloudfront_s3_cdn" {
source = "git::https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn.git?ref=tags/0.35.0"
acm_certificate_arn = module.acm_request_certificate.arn
aliases = [var.domain_name, "www.${var.domain_name}"]
allowed_methods = ["GET", "HEAD"]
compress = true
dns_alias_enabled = true
error_document = "not_found.html"
namespace = var.company_prefix
name = var.name
origin_force_destroy = true
parent_zone_id = aws_route53_zone.default.zone_id
stage = var.stage
use_regional_s3_endpoint = true
website_enabled = true
tags = local.tags
} It always fails the first time with: Error: error creating CloudFront Distribution: InvalidViewerCertificate: The specified SSL certificate doesn't exist, isn't in us-east-1 region, isn't valid, or doesn't include a valid certificate chain.
status code: 400, request id: bfc311ca-052f-5269-92b0-e66070178e7d
on .terraform/modules/cloudfront_s3_cdn/main.tf line 184, in resource "aws_cloudfront_distribution" "default":
184: resource "aws_cloudfront_distribution" "default" { I have to run this always for the second time. I'm using variable "aws_region" {
description = "The AWS region to deploy to"
type = string
default = "us-east-1"
} |
@x80486 looks like it's a race condition. |
Why I didn't think about that I'll check the apply in two stages using |
@aknysh This link is dead; can you provide a link to a current working example of how to do this? |
thanks @aknysh, but it's not clear to me how I can use this example. Forgive me for what is probably a basic question as I'm new to Terraform. I have an existing certificate already in If I do something like this:
How do I then specify for the module that it should use |
Closing as fixed by #26. If people are still having problems with current Terraform providers and Cloud Posse modules, please create a new issue. |
This has been discussed on closed issues, but I am having issue with terraform to retreive cert from us-east-1 region and apply it with Cloudformation in eu-west-1 region.
My config is like this:
So when Cloudformation request happen I see in the post method in TF_LOG file:
nonearn:aws:acm:us-east-1:account number:certificate/cert number>
And its correct ARN its correct...
The text was updated successfully, but these errors were encountered: