<commit_before>resource "aws_s3_bucket" "main" {
    bucket = "${var.name}"

    acl = "${var.acl}"

    force_destroy = true

    versioning {
        enabled = false
    }

    website {
        index_document = "index.html"
        error_document = "error.html"
    }

  policy = <<POLICY
{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"PublicReadForGetBucketObjects",
      "Effect":"Allow",
      "Principal": "*",
      "Action":"s3:GetObject",
      "Resource":["arn:aws:s3:::${var.name}/*"
      ]
    }
  ]
}
POLICY

#     cors_rule {
#         allowed_headers = ["*"]
#         allowed_methods = ["GET", "PUT", "POST"]
#         allowed_origins = [ <<EOF
# ${compact(
#     concat(var.cors_origin0, 
#            var.cors_origin1, 
#            var.cors_origin2, 
#            var.cors_origin3, 
#            var.cors_origin4,           
#            var.cors_origin5, 
#            var.cors_origin6, 
#            var.cors_origin7)
#          )}
# EOF
#         ]
#         expose_headers = ["ETag"]
#         max_age_seconds = 3000
#     }

    tags {
        Name = "${var.name}"
        Environment = "${coalesce(var.environment, var.name)}"
    }
}

resource "aws_s3_bucket_object" "index_document" {
  bucket       = "${aws_s3_bucket.main.bucket}"
  key          = "index.html"
  source       = "${path.module}/index.html"
  content_type = "text/html"
}<commit_msg>removed index.html<commit_after>resource "aws_s3_bucket" "main" {
    bucket = "${var.name}"

    acl = "${var.acl}"

    force_destroy = true

    versioning {
        enabled = false
    }

    website {
        index_document = "index.html"
        error_document = "error.html"
    }

  policy = <<POLICY
{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"PublicReadForGetBucketObjects",
      "Effect":"Allow",
      "Principal": "*",
      "Action":"s3:GetObject",
      "Resource":["arn:aws:s3:::${var.name}/*"
      ]
    }
  ]
}
POLICY

#     cors_rule {
#         allowed_headers = ["*"]
#         allowed_methods = ["GET", "PUT", "POST"]
#         allowed_origins = [ <<EOF
# ${compact(
#     concat(var.cors_origin0, 
#            var.cors_origin1, 
#            var.cors_origin2, 
#            var.cors_origin3, 
#            var.cors_origin4,           
#            var.cors_origin5, 
#            var.cors_origin6, 
#            var.cors_origin7)
#          )}
# EOF
#         ]
#         expose_headers = ["ETag"]
#         max_age_seconds = 3000
#     }

    tags {
        Name = "${var.name}"
        Environment = "${coalesce(var.environment, var.name)}"
    }
}

# resource "aws_s3_bucket_object" "index_document" {
#   bucket       = "${aws_s3_bucket.main.bucket}"
#   key          = "index.html"
#   source       = "${path.module}/index.html"
#   content_type = "text/html"
# }
{'fraction_non_alphanumeric': 0.16207513416815741, 'fraction_numerical': 0.017889087656529516, 'mean_word_length': 1.9338929695697797, 'pattern_counts': {'":': 14, '<': 11, '<?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': '4773666', 'n_tokens_mistral': 1018, 'n_tokens_neox': 975, 'n_words': 133}