hashicorp / terraform-provider-dyn

Terraform Dyn provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://registry.terraform.io
Mozilla Public License 2.0
7 stars 16 forks source link

Dyn Remote State Issue #8

Closed lczxpplnzeey closed 6 years ago

lczxpplnzeey commented 7 years ago

Hi there,

Running into an issue where I successfully apply a terraform plan to create CNAME records in DYN. However when I rerun terraform plan again, I expected that there be zero changes. Instead, I get the same 3 records I created in the terrform plan.

build   11-Jul-2017 14:46:48    ~ dyn_record.demoz
build   11-Jul-2017 14:46:48        value: "nonssl.us-eu.fastly.net." => "nonssl.us-eu.fastly.net"
build   11-Jul-2017 14:46:48    
build   11-Jul-2017 14:46:48    ~ dyn_record.demozz
build   11-Jul-2017 14:46:48        value: "nonssl.us-eu.fastly.net." => "nonssl.us-eu.fastly.net"
build   11-Jul-2017 14:46:48    
build   11-Jul-2017 14:46:48    ~ dyn_record.demozzz
build   11-Jul-2017 14:46:48        value: "nonssl.us-eu.fastly.net." => "nonssl.us-eu.fastly.net"
build   11-Jul-2017 14:46:48    
build   11-Jul-2017 14:46:48    
build   11-Jul-2017 14:46:48    Plan: 0 to add, 3 to change, 0 to destroy.

The remote state is working as I have a cloudflare and fastly configs. These correctly state no changes.

So to sum it up, I have 3 tf configs, one for dyn, cloudflare, and fastly. The remote state config is in fastly config. (there doesn't seem to be documentation on where or if it matters where teh remote state config needs to be put, if there are multiple files.)

Terraform Version

Terraform v0.9.11

Affected Resource(s)

Please list the resources as a list, for example: resource "dyn_record" "demoz" resource "dyn_record" "demozz" resource "dyn_record" "demozzz"

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

variable "dyn_user" {

}

variable "dyn_api" {

}

provider "dyn" {
  customer_name = "<some company>"
  username      = "${var.dyn_user}"
  password      = "${var.dyn_api}"
}

resource "dyn_record" "demoz" {
  zone  = "advance-dev.com"
  name  = "demoz"
  #value = "demoz.advance-dev.com.cdn.cloudflare.net"
  value = "nonssl.us-eu.fastly.net"
  type  = "CNAME"
  ttl = "60"
}

resource "dyn_record" "demozz" {
  zone  = "advance-dev.com"
  name  = "demozz"
  #value = "demoz.advance-dev.com.cdn.cloudflare.net"
  value = "nonssl.us-eu.fastly.net"
  type  = "CNAME"
  ttl = "60"
}

resource "dyn_record" "demozzz" {
  zone  = "advance-dev.com"
  name  = "demozzz"
  #value = "demoz.advance-dev.com.cdn.cloudflare.net"
  value = "nonssl.us-eu.fastly.net"
  type  = "CNAME"
  ttl = "60"
}

Expected Behavior

Terraform plan should say there should not be anything to change.

Actual Behavior

Terraform plan says there are DYN records to change.

Steps to Reproduce

Brand new env

  1. terraform plan
  2. terraform apply
  3. terraform plan again