You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The acm-cloudfront branch uses ACM for SSL certificate and Cloudfront for CDN. This configuration is more complex and works even if your S3 bucket name is already taken.
If this branch is supposed to be a setup for CloudFront, curious why this still contains CloudFlare code in it? Is that still needed?
provider"cloudflare" {}
...data"cloudflare_zones""domain" {
filter {
name=var.site_domain
}
}
resource"cloudflare_record""acm" {
zone_id=data.cloudflare_zones.domain.zones[0].id// Cloudflare doesn't support `allow_overwrite` field like the route53_record // resource; as a result, this configuration hardcodes the first record to // verify the ACM certificate.// for_each = {// for dvo in aws_acm_certificate.cert.domain_validation_options : dvo.domain_name => {// name = dvo.resource_record_name// record = dvo.resource_record_value// type = dvo.resource_record_type// }// }name=aws_acm_certificate.cert.domain_validation_options.*.resource_record_name[0]
type=aws_acm_certificate.cert.domain_validation_options.*.resource_record_type[0]
value=trimsuffix(aws_acm_certificate.cert.domain_validation_options.*.resource_record_value[0], ".")
// Must be set to false. ACM validation false otherwiseproxied=false
}
...resource"cloudflare_record""site_cname" {
zone_id=data.cloudflare_zones.domain.zones[0].idname=var.site_domainvalue=aws_cloudfront_distribution.dist.domain_nametype="CNAME"ttl=1proxied=true
}
resource"cloudflare_record""www" {
zone_id=data.cloudflare_zones.domain.zones[0].idname="www"value=aws_cloudfront_distribution.dist.domain_nametype="CNAME"ttl=1proxied=true
}
The text was updated successfully, but these errors were encountered:
https://github.com/hashicorp/learn-terraform-cloudflare-static-website/blob/acm-cloudfront/main.tf
If this branch is supposed to be a setup for CloudFront, curious why this still contains CloudFlare code in it? Is that still needed?
The text was updated successfully, but these errors were encountered: