※ この記事を書いてから1年以上経ってるかも
GCP の Cloud DNS を Terraform から設定しようとしたところ、以下のエラーに遭遇。
Error creating ManagedZone: googleapi: Error 400: Invalid value for 'entity.managedZone.dnsName': 'example.com', invalid
そのときの tf ファイルは以下のような感じ。
resource "google_dns_managed_zone" "example-zone" {
name = "example-zone"
dns_name = "example.com"
description = "Example DNS zone"
}
dns_name の値の末尾に . が必要だった。
resource "google_dns_managed_zone" "example-zone" {
name = "example-zone"
dns_name = "example.com."
description = "Example DNS zone"
}
これで解決!