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 always replaces(destroy & create) GKE autopilot #10522

Closed
kanjih opened this issue Nov 9, 2021 · 2 comments
Closed

Terraform always replaces(destroy & create) GKE autopilot #10522

kanjih opened this issue Nov 9, 2021 · 2 comments
Assignees
Labels

Comments

@kanjih
Copy link

kanjih commented Nov 9, 2021

Terraform Version

v1.0.8

Affected Resource

  • google_container_cluster

Terraform Configuration Files

resource "google_container_cluster" "default" {
  name     = "test"
  location = "asia-northeast1"

  network    = {id of existing vpc}
  subnetwork = {id of existing subnetwork}

  enable_autopilot = true

  node_config {
    oauth_scopes = [
      "https://www.googleapis.com/auth/cloud-platform",
      "https://www.googleapis.com/auth/monitoring",
    ]
  }
}

Expected Behavior

When I exec terrafrom plan with the above same code, terraform shows there's no change and terraform won't do anything.

Actual Behavior

When I exec terrafrom plan with the above same code, terraform says it will replace (destroy & create) the gke cluster even though there's no change.
If the code doens't have node_config, it won't happen.

Steps to Reproduce

  1. write the above code
  2. call terraform init
  3. call terraform apply
  4. call terraform apply again
@kanjih kanjih added the bug label Nov 9, 2021
@c2thorn
Copy link
Collaborator

c2thorn commented Nov 10, 2021

@kanjih node_config.oauth_scopes does not seem to be configurable with Autopilot enabled. I'd recommend removing the field since the backend will just replace your values automatically.

It'd be nice if the provider prevented you from trying to attempt this, but I'm not sure that is possible with how node_config is structured internally.

@c2thorn c2thorn closed this as completed Nov 10, 2021
@c2thorn c2thorn self-assigned this Nov 10, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants