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

digitalocean_record MX generates invalid state #10333

Closed
danielsreichenbach opened this issue Nov 24, 2016 · 1 comment
Closed

digitalocean_record MX generates invalid state #10333

danielsreichenbach opened this issue Nov 24, 2016 · 1 comment

Comments

@danielsreichenbach
Copy link

Terraform Version

Terraform v0.7.12

Affected Resource(s)

  • digitalocean_record

Terraform Configuration Files

resource "digitalocean_domain" "acme" {
   name        = "acme.com"
   ...
}

resource "digitalocean_record" "mx-acme-mx" {
  domain    = "${digitalocean_domain.acme.name}"
  type      = "MX"
  priority  = 1
  value     = "mx.acme.com."
}

Expected Behavior

This should generated a domain named acme.com with a MX record pointing to mx.acme.com, and store the state correctly.

Actual Behavior

Generates domain and MX record properly but terraform.tfstate is broken afterwards, it will contain

                        "attributes": {
                            "domain": "acme",
                            "fqdn": "@.acme.com",
                            "id": "19638502",
                            "name": "@",
                            "port": "0",
                            "priority": "1",
                            "type": "MX",
                            "value": "mx.acme.com.acme.com.",
                            "weight": "0"
                        }

Changing the resource configuration to this

resource "digitalocean_record" "mx-acme-mx" {
  domain    = "${digitalocean_domain.acme.name}"
  type      = "MX"
  priority  = 1
  value     = "mx."
}

will properly generate a state of

                         "attributes": {
                             "domain": "acme.com",
                             "fqdn": "@.acme.com",
                            "id": "19638637",
                             "name": "@",
                             "port": "0",
                             "priority": "1",
                             "type": "MX",
                            "value": "mx.acme.com.",
                             "weight": "0"
                         },

Executing terraform plan before and afterwards will however always result in this plan:

-/+ digitalocean_record.mx-acme-mx
    domain:   "acme.com" => "acme.com"
    fqdn:     "@.acme.com" => "<computed>"
    name:     "@" => ""
    port:     "0" => "<computed>"
    priority: "1" => "1"
    type:     "MX" => "MX"
    value:    "mx.acme.com.acme.com." => "mx." (forces new resource)
    weight:   "0" => "<computed>"

Steps to Reproduce

  1. terraform apply
  2. terraform plan
@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants