a day ago
- Setting up a static website on AWS involves Route53, CloudFront, S3, and ACM, but common issues arise with www vs non-www domain configuration: a separate A record must be created for each, and both added to CloudFront's Alternate Domain Names.
- SSL certificates via ACM must cover both domains (www and non-www) as separate SANs; ACM does not allow editing existing certificates, so a new certificate with both domains is required. Terraform may have inconsistencies when configuring this.
- S3 redirection rules to append index.html for Hugo-generated sites only work when using the S3 website endpoint (s3-website-<region>.amazonaws.com), not the API endpoint. This requires the bucket to be public, which may allow direct access bypassing CloudFront.