Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform destroy fails #28

Open
TrejGun opened this issue Jun 18, 2019 · 3 comments
Open

terraform destroy fails #28

TrejGun opened this issue Jun 18, 2019 · 3 comments

Comments

@TrejGun
Copy link

TrejGun commented Jun 18, 2019

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
@TrejGun
Copy link
Author

TrejGun commented Jun 18, 2019

same as in this comment #11 (comment)

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

@TrejGun
Copy link
Author

TrejGun commented Jun 18, 2019

ok i see now

@TrejGun TrejGun closed this as completed Jun 18, 2019
@TrejGun
Copy link
Author

TrejGun commented Jun 18, 2019

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
        }
    }

@TrejGun TrejGun reopened this Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant