TXTレコード
Text Record
任意のテキスト情報を格納。SPF, DKIM, Googleサイト認証などに利用。
例: "v=spf1 include:_spf.google.com ~all"
code:tf(rb)
# SPF の例(送信許可範囲)
resource "aws_route53_record" "txt_spf" {
zone_id = aws_route53_zone.this.zone_id
name = "example.com"
type = "TXT"
ttl = 300
records = [
"\"v=spf1 include:_spf.google.com ~all\""
]
}
# ドメイン所有確認やAPI連携のトークンを置くことも多い
resource "aws_route53_record" "txt_verify" {
zone_id = aws_route53_zone.this.zone_id
name = "_google-site-verification.example.com"
type = "TXT"
ttl = 300
}
TXTはダブルクォートで囲む(Terraformでは "\"...\"" のようにエスケープ)