summaryrefslogtreecommitdiff
path: root/infrastructure/cloudfront.tf
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+joeacarstairs@users.noreply.github.com>2024-05-10 21:57:35 +0100
committerGitHub <noreply@github.com>2024-05-10 21:57:35 +0100
commit88c6e8a6585c00f0a94e27f1351e77ef18518196 (patch)
tree18c7485fddabdedd7c2b7b57844c22cf9c1b5954 /infrastructure/cloudfront.tf
parentefb931b1b8e3d0d0be3665304a34b2b2b1b5a90e (diff)
Moves to DigitalOcean from AWS (#4)
* Moves to DigitalOcean from AWS * README * Removes deployment workflow --------- Co-authored-by: Joe Carstairs <65492573+Sycamost@users.noreply.github.com>
Diffstat (limited to 'infrastructure/cloudfront.tf')
-rw-r--r--infrastructure/cloudfront.tf59
1 files changed, 0 insertions, 59 deletions
diff --git a/infrastructure/cloudfront.tf b/infrastructure/cloudfront.tf
deleted file mode 100644
index 4cdc80c..0000000
--- a/infrastructure/cloudfront.tf
+++ /dev/null
@@ -1,59 +0,0 @@
-resource "aws_cloudfront_distribution" "joeac" {
- enabled = true
- is_ipv6_enabled = true
- default_root_object = "index.html"
- price_class = "PriceClass_100"
-
- aliases = ["joeac.net"]
-
- origin {
- domain_name = aws_s3_bucket_website_configuration.website.website_endpoint
- origin_id = local.website_origin_id
-
- custom_origin_config {
- http_port = 80
- https_port = 443
- origin_protocol_policy = "http-only"
- origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
- }
- }
-
- default_cache_behavior {
- allowed_methods = ["GET", "HEAD", "OPTIONS"]
- cached_methods = ["GET", "HEAD", "OPTIONS"]
- target_origin_id = local.website_origin_id
- cache_policy_id = data.aws_cloudfront_cache_policy.caching_optimized.id
- viewer_protocol_policy = "redirect-to-https"
- }
-
- restrictions {
- geo_restriction {
- restriction_type = "none"
- locations = []
- }
- }
-
- viewer_certificate {
- acm_certificate_arn = data.aws_acm_certificate.joeac_ssl_certificate.arn
- ssl_support_method = "sni-only"
- minimum_protocol_version = "TLSv1.2_2021"
- }
-
- depends_on = [aws_cloudfront_origin_access_control.website]
-}
-
-resource "aws_cloudfront_origin_access_control" "website" {
- name = "website"
- origin_access_control_origin_type = "s3"
- signing_behavior = "always"
- signing_protocol = "sigv4"
-}
-
-data "aws_cloudfront_cache_policy" "caching_optimized" {
- name = "Managed-CachingOptimized"
-}
-
-locals {
- website_origin_id = "website"
-}
-