<commit_before>data "aws_route53_zone" "main" {
    name = "${var.site_name}"
}

resource "aws_route53_record" "cert_validation" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${aws_acm_certificate.main.domain_validation_options.0.resource_record_name}"
    type = "${aws_acm_certificate.main.domain_validation_options.0.resource_record_type}"
    records = [
        "${aws_acm_certificate.main.domain_validation_options.0.resource_record_value}"
    ]

    ttl = "60"
}

resource "aws_route53_record" "site" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${var.site_name}"
    type = "A"

    alias {
        zone_id = "${aws_cloudfront_distribution.main.hosted_zone_id}"
        name = "${aws_cloudfront_distribution.main.domain_name}"
        evaluate_target_health = false
    }
}

## https://docs.aws.amazon.com/ses/latest/DeveloperGuide/dns-txt-records.html
resource "aws_route53_record" "pbe_verification" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "_amazonses.${aws_ses_domain_identity.pbe.domain}"
    type = "TXT"
    ttl = "60"
    records = [
        "${aws_ses_domain_identity.pbe.verification_token}"
    ]
}

resource "aws_route53_record" "pbe_dkim" {
    count = 3

    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "${element(aws_ses_domain_dkim.pbe.dkim_tokens, count.index)}._domainkey.${aws_ses_domain_identity.pbe.domain}"
    type = "CNAME"
    ttl = "60"
    records = [
        "${element(aws_ses_domain_dkim.pbe.dkim_tokens, count.index)}.dkim.amazonses.com"
    ]
}

resource "aws_route53_record" "pbe_mx" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${aws_ses_domain_identity.pbe.domain}"
    type = "MX"
    records = [
        "10 inbound-smtp.${var.aws_region}.amazonaws.com"
    ]

    ttl = "60"
}

resource "aws_route53_record" "keybase_proof" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "_keybase.${aws_ses_domain_identity.pbe.domain}"
    type = "TXT"
    ttl = "60"
    records = [
        "keybase-site-verification=<KEY>"
    ]
}<commit_msg>Correct name for keybase proof<commit_after>data "aws_route53_zone" "main" {
    name = "${var.site_name}"
}

resource "aws_route53_record" "cert_validation" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${aws_acm_certificate.main.domain_validation_options.0.resource_record_name}"
    type = "${aws_acm_certificate.main.domain_validation_options.0.resource_record_type}"
    records = [
        "${aws_acm_certificate.main.domain_validation_options.0.resource_record_value}"
    ]

    ttl = "60"
}

resource "aws_route53_record" "site" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${var.site_name}"
    type = "A"

    alias {
        zone_id = "${aws_cloudfront_distribution.main.hosted_zone_id}"
        name = "${aws_cloudfront_distribution.main.domain_name}"
        evaluate_target_health = false
    }
}

## https://docs.aws.amazon.com/ses/latest/DeveloperGuide/dns-txt-records.html
resource "aws_route53_record" "pbe_verification" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "_amazonses.${aws_ses_domain_identity.pbe.domain}"
    type = "TXT"
    ttl = "60"
    records = [
        "${aws_ses_domain_identity.pbe.verification_token}"
    ]
}

resource "aws_route53_record" "pbe_dkim" {
    count = 3

    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "${element(aws_ses_domain_dkim.pbe.dkim_tokens, count.index)}._domainkey.${aws_ses_domain_identity.pbe.domain}"
    type = "CNAME"
    ttl = "60"
    records = [
        "${element(aws_ses_domain_dkim.pbe.dkim_tokens, count.index)}.dkim.amazonses.com"
    ]
}

resource "aws_route53_record" "pbe_mx" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"

    name = "${aws_ses_domain_identity.pbe.domain}"
    type = "MX"
    records = [
        "10 inbound-smtp.${var.aws_region}.amazonaws.com"
    ]

    ttl = "60"
}

resource "aws_route53_record" "keybase_proof" {
    zone_id = "${data.aws_route53_zone.main.zone_id}"
    name = "_keybase.${var.site_name}"
    type = "TXT"
    ttl = "60"
    records = [
        "keybase-site-verification=<KEY>"
    ]
}
{'fraction_non_alphanumeric': 0.14444971537001897, 'fraction_numerical': 0.019924098671726755, 'mean_word_length': 3.62390350877193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4472019', 'n_tokens_mistral': 1638, 'n_tokens_neox': 1571, 'n_words': 188}