Skip to content

Commit 6a249d2

Browse files
committed
fix: add us-east-1 as provider for certificate and certificate validation
1 parent 86b4c5d commit 6a249d2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ resource "aws_acm_certificate" "wildcard_cert" {
1010
subject_alternative_names = [
1111
"*.${aws_route53_zone.this.name}"
1212
]
13+
14+
provider = aws.us_east_1 # ACM certificates must be created in us-east-1 for CloudFront
1315
}
1416

1517
resource "aws_acm_certificate_validation" "wildcard_cert" {
1618
certificate_arn = aws_acm_certificate.wildcard_cert.arn
1719
validation_record_fqdns = [
1820
aws_route53_record.wildcard_cert_validation.fqdn
1921
]
22+
provider = aws.us_east_1
2023
}
2124

2225
resource "aws_route53_record" "wildcard_cert_validation" {
@@ -34,11 +37,13 @@ resource "aws_ssm_parameter" "hosted_zone_id" {
3437
value = aws_route53_zone.this.zone_id
3538
description = "Route53 Hosted Zone ID for ${aws_route53_zone.this.name}"
3639
type = "String"
40+
overwrite = true
3741
}
3842

3943
resource "aws_ssm_parameter" "wildcard_cert_arn" {
4044
name = "/certificates/${replace(aws_route53_zone.this.name, ".", "-DOT-")}/wildcard/arn"
4145
value = aws_acm_certificate.wildcard_cert.arn
4246
description = "Wildcard Certificate ARN of *.${aws_route53_zone.this.name}"
4347
type = "String"
48+
overwrite = true
4449
}

providers.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ terraform {
33

44
required_providers {
55
aws = {
6-
source = "hashicorp/aws"
7-
version = ">= 5.0" # minimum 5.x is required to be able to use this module
6+
source = "hashicorp/aws"
7+
version = ">= 5.0" # minimum 5.x is required to be able to use this module
8+
configuration_aliases = [aws.us_east_1]
89
}
910
}
1011
}

0 commit comments

Comments
 (0)