n3integration/terraform-provider-godaddy

terraform destroy fails

TrejGun opened this issue · 3 comments

variable "domain_name" {
  description = "The domain name"
  default     = "example.com" # use real domain
}

variable "aws_region" {
  description = "The AWS region things are created in"
  default     = "eu-west-1"
}

variable "app_name" {
  description = "Application name"
  default     = "example"
}

provider "aws" {
  shared_credentials_file = "$HOME/.aws/credentials"
  profile = "${var.app_name}"
  region = "${var.aws_region}"
  version = "~> 2.13"
}

provider "godaddy" {
  key = "~"
  secret = "~"
}

resource "aws_route53_zone" "main" {
  name = "${var.domain_name}."
}

resource "godaddy_domain_record" "main" {
  domain = "${var.domain_name}"

  nameservers = [
    "${aws_route53_zone.main.name_servers.0}",
    "${aws_route53_zone.main.name_servers.1}",
    "${aws_route53_zone.main.name_servers.2}",
    "${aws_route53_zone.main.name_servers.3}",
  ]
}

This script created Hosted Zone and applied name servers but when I run terraform destroy it says

➜  terraform git:(master) ✗ terraform destroy
aws_route53_zone.main: Refreshing state... [id=Z8SD9E0E9WXP9]
godaddy_domain_record.main: Refreshing state... [id=291678829]

Error: couldn't find domain record (example.com): [404:UNKNOWN_DOMAIN] The given domain is not registered, or does not have a zone file

same as in this comment #11 (comment)

setting the DNS servers to "default" in GoDaddy clears the error.

ok i see now

still it offers me to update record each time I call terraform apply

 # godaddy_domain_record.main will be updated in-place
  ~ resource "godaddy_domain_record" "main" {
        addresses   = []
        domain      = "example.com"
        id          = "291678829"
      ~ nameservers = [
          - "ns55.domaincontrol.com",
          - "ns56.domaincontrol.com",
          + "ns-1039.awsdns-01.org",
          + "ns-2001.awsdns-58.co.uk",
          + "ns-280.awsdns-35.com",
          + "ns-727.awsdns-26.net",
        ]

      - record {
          - data     = "@" -> null
          - name     = "www" -> null
          - priority = 0 -> null
          - ttl      = 3600 -> null
          - type     = "CNAME" -> null
        }
      - record {
          - data     = "Parked" -> null
          - name     = "@" -> null
          - priority = 0 -> null
          - ttl      = 600 -> null
          - type     = "A" -> null
        }
      - record {
          - data     = "_domainconnect.gd.domaincontrol.com" -> null
          - name     = "_domainconnect" -> null
          - priority = 0 -> null
          - ttl      = 3600 -> null
          - type     = "CNAME" -> null
        }
    }