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

data.google_dns_managed_zone prompts an "read" update always #1902

Closed
ramyala opened this issue Aug 18, 2018 · 2 comments
Closed

data.google_dns_managed_zone prompts an "read" update always #1902

ramyala opened this issue Aug 18, 2018 · 2 comments

Comments

@ramyala
Copy link

ramyala commented Aug 18, 2018

Terraform Version

Terraform v0.11.8

  • provider.aws v1.32.0
  • provider.github v1.2.1
  • provider.google v1.16.2
  • provider.helm (unversioned)
  • provider.kubernetes v1.2.0
  • provider.local v1.1.0
  • provider.random v2.0.0
  • provider.template v1.0.0
  • provider.tls v1.2.0

Affected Resource(s)

  • google_dns_managed_zone

Terraform Configuration Files

resource "google_project_service" "dns" {
  service = "dns.googleapis.com"
}
data "google_dns_managed_zone" "my_zone" {
  name    = "${local.dns_zone}"
  project = "${var.root_project}"

  depends_on = ["google_project_service.dns"]
}

Debug Output

$ tf apply
...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 <= read (data resources)

Terraform will perform the following actions:

 <= data.google_dns_managed_zone.my_zone
      id:             <computed>
      description:    <computed>
      dns_name:       <computed>
      name:           "my-zone"
      name_servers.#: <computed>
      project:        "root-project"

Expected Behavior

We shouldn't be prompted once the data is read and no changes were detected subsequently. The behavior should be in-line with other data objects.

Actual Behavior

tf apply always prompts to read from data.google_dns_managed_zone.my_zone. Thus as a side-effect any dependency on attributes from this data object will be asked to update/recreate.

@emilymye
Copy link
Contributor

@ramyala Thanks for submitting this issue! I believe this is a side effect of how depends_on works for data sources in Terraform core. See hashicorp/terraform#11806. Unfortunately, that means I don't have an easy answer other than to remove the dependency on the project service object. If you have any other questions, please let me know!

@ghost
Copy link

ghost commented Nov 17, 2018

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

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

No branches or pull requests

2 participants