<commit_before>provider "aws" {
    region = "us-west-2"
}

resource "aws_s3_bucket" "b" {
  bucket = "${var.bucket_name}"
  acl    = "public-read"
  policy = <<EOF
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::${var.bucket_name}/*"
        }
    ]
}
EOF

  website {
    index_document = "index.html"
    error_document = "404.html"
  }
}
<commit_msg>Add routing_rules to s3 terraform<commit_after>provider "aws" {
    region = "us-west-2"
}

resource "aws_s3_bucket" "b" {
  bucket = "${var.bucket_name}"
  acl    = "public-read"
  policy = <<EOF
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::${var.bucket_name}/*"
        }
    ]
}
EOF

  website {
    index_document = "index.html"
    error_document = "404.html"
    routing_rules = <<EOF
[{
    "Condition": {
        "KeyPrefixEquals": "feed.xml"
    },
    "Redirect": {
        "HostName": "harringa.com",
        "ReplaceKeyWith": "posts/index.xml"
    }
}]
EOF

  }
}

{'fraction_non_alphanumeric': 0.18250950570342206, 'fraction_numerical': 0.023574144486692015, 'mean_word_length': 2.118483412322275, 'pattern_counts': {'":': 19, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1423732', 'n_tokens_mistral': 494, 'n_tokens_neox': 471, 'n_words': 77}