<commit_before>variable "domain" {}
variable "region" {}

variable "origin_id" {
  default = "public_bucket"
}

provider "aws" {
  region = "${var.region}"
}

resource "aws_s3_bucket" "b" {
  bucket        = "${var.domain}"
  acl           = "private"
  force_destroy = true
}

resource "aws_cloudfront_distribution" "d" {
  origin {
    domain_name = "${aws_s3_bucket.b.bucket_domain_name}"
    origin_id   = "${var.origin_id}"
  }

  enabled             = true
  is_ipv6_enabled     = true
  default_root_object = "index.html"

  aliases = ["${var.domain}"]

  default_cache_behavior {
    allowed_methods        = ["GET", "HEAD"]
    cached_methods         = ["GET", "HEAD"]
    target_origin_id       = "${var.origin_id}"
    viewer_protocol_policy = "redirect-to-https"
    min_ttl                = 0
    default_ttl            = 3600
    max_ttl                = 86400

    forwarded_values {
      query_string = false

      cookies {
        forward = "none"
      }
    }
  }

  viewer_certificate {
    acm_certificate_arn      = "arn:aws:acm:us-east-1:515821172331:certificate/c5a1e033-46e8-4441-a6f9-b4a7b1ab2b2e"
    minimum_protocol_version = "TLSv1"
    ssl_support_method       = "sni-only"
  }

  restrictions {
    geo_restriction {<commit_msg>Set price class<commit_after>variable "domain" {}
variable "region" {}

variable "origin_id" {
  default = "public_bucket"
}

provider "aws" {
  region = "${var.region}"
}

resource "aws_s3_bucket" "b" {
  bucket        = "${var.domain}"
  acl           = "private"
  force_destroy = true
}

resource "aws_cloudfront_distribution" "d" {
  origin {
    domain_name = "${aws_s3_bucket.b.bucket_domain_name}"
    origin_id   = "${var.origin_id}"
  }

  enabled             = true
  is_ipv6_enabled     = true
  default_root_object = "index.html"

  aliases = ["${var.domain}"]

  default_cache_behavior {
    allowed_methods        = ["GET", "HEAD"]
    cached_methods         = ["GET", "HEAD"]
    target_origin_id       = "${var.origin_id}"
    viewer_protocol_policy = "redirect-to-https"
    min_ttl                = 0
    default_ttl            = 3600
    max_ttl                = 86400

    forwarded_values {
      query_string = false

      cookies {
        forward = "none"
      }
    }
  }

  viewer_certificate {
    acm_certificate_arn      = "arn:aws:acm:us-east-1:515821172331:certificate/c5a1e033-46e8-4441-a6f9-b4a7b1ab2b2e"
    minimum_protocol_version = "TLSv1"
    ssl_support_method       = "sni-only"
  }

  price_class = "PriceClass_200"

  restrictions {
    geo_restriction {
{'fraction_non_alphanumeric': 0.11826697892271663, 'fraction_numerical': 0.03708040593286495, 'mean_word_length': 2.4495289367429343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '687651', 'n_tokens_mistral': 974, 'n_tokens_neox': 906, 'n_words': 142}