A Terraform reference for serving one static page through HTTPS with CloudFront while S3 blocks public access. The configuration keeps the origin private and permits object reads only from the CloudFront distribution.
CloudFront uses Origin Access Control to sign requests to the encrypted, versioned S3 bucket. S3 public access block remains enabled.
This template was not applied to AWS. CloudFront requests, data transfer and S3 usage can incur charges; free-tier terms change and are not guaranteed here. It intentionally omits DNS, custom domains, WAF, access logs and analytics. Terraform state can contain infrastructure details, so store it privately and never upload state or credentials.