terraformdns / terraform-google-dns-recordsets

Terraform module for creating DNS recordsets in a Google Cloud DNS zone
MIT License
0 stars 1 forks source link

project_id error #1

Open mr-smithers-excellent opened 6 years ago

mr-smithers-excellent commented 6 years ago

Newish Terraform user here, so apologies if I'm missing something. Attempted to run your example and I'm getting the following error after running a terraform get

Error loading modules: module dns_records: Error parsing .terraform/modules/8347a17291dd1c0dc31ddb7b5b4d726d/terraformdns-terraform-google-dns-recordsets-10d73c9/main.tf: At 10:13: Unknown token: 10:13 IDENT var.project_id

For reference here is the complete content of my main.tf

provider "google" {
  credentials = "${file("account.json")}"
  project     = "my-gce-project-id"
  region      = "us-central1"
}

resource "google_dns_managed_zone" "example" {
  name     = "terraformdns-example"
  dns_name = "example.com."
}

module "dns_records" {
  source = "terraformdns/dns-recordsets/google"

  project_id        = "example-project-id"
  managed_zone_name = "google_dns_managed_zone.example.name"
  recordsets = [
    {
      name    = "www"
      type    = "A"
      ttl     = 3600
      records = [
        "192.0.2.56",
      ]
    },
    {
      name    = ""
      type    = "MX"
      ttl     = 3600
      records = [
        "1 mail1",
        "5 mail2",
        "5 mail3",
      ]
    },
    {
      name    = ""
      type    = "TXT"
      ttl     = 3600
      records = [
        "\"v=spf1 ip4:192.0.2.3 include:backoff.${google_dns_managed_zone.example.dns_name} -all\"",
      ]
    },
    {
      name    = "_sip._tcp"
      type    = "SRV"
      ttl     = 3600
      records = [
        "10 60 5060 sip1",
        "10 20 5060 sip2",
        "10 20 5060 sip3",
        "20  0 5060 sip4",
      ]
    },
  ]
}
joakimhellum commented 5 years ago

What version of Terraform are you using when attempting to run the example? The error message typically occurs when trying to use pre-0.12 version with a module that uses 0.12-only features. You can run terraform version to check current version.

This module is still experimental and depends on Terraform v0.12-only features.

You can try this module with the first Terraform 0.12 beta release that was recently accounced, or use one of the previous 0.12 alpha releases that also contain bundled experimental google provider build.