terraform-provider-google: Upgrade to 4.34.0 breaks on `node_pool_auto_config` block with `google-beta` provider
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to the
modular-magicianuser, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot, a community member has claimed the issue already.
Terraform Version
Terraform v1.2.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/external v2.2.2
+ provider registry.terraform.io/hashicorp/google v4.34.0
+ provider registry.terraform.io/hashicorp/google-beta v4.34.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.13.1
+ provider registry.terraform.io/hashicorp/null v3.1.1
+ provider registry.terraform.io/hashicorp/random v3.3.2
+ provider registry.terraform.io/hashicorp/time v0.8.0
Affected Resource(s)
- google_container_cluster
Terraform Configuration Files
Weβre using a module within a module within a module to create the cluster (terraform-google-modules/kubernetes-engine/google//modules/safer-cluster-update-variant) - I can try to produce a minimal example with just the resource if necessary, but Iβm unsure whether itβs relevant, maybe this is already enough.
Debug Output
Panic Output
Expected Behavior
Plan shows that changes outside of Terraform were made:
# module.project.module.gke.module.gke.google_container_cluster.primary has changed
~ resource "google_container_cluster" "primary" {
id = "projects/***/locations/europe-west4/clusters/***"
name = "***"
# (28 unchanged attributes hidden)
+ node_pool_auto_config {
}
# (22 unchanged blocks hidden)
}
With this change to be rolled back:
# module.project.module.gke.module.gke.google_container_cluster.primary will be updated in-place
~ resource "google_container_cluster" "primary" {
id = "projects/***/locations/europe-west4/clusters/***"
name = "***"
# (28 unchanged attributes hidden)
- node_pool_auto_config {
}
# (22 unchanged blocks hidden)
}
I would expect this to either succeed, or the change outside of Terraform to not happen in the first place.
Actual Behavior
Apply fails with error
Error: Provider produced inconsistent final plan
When expanding the plan for
module.project.module.gke.module.gke.google_container_cluster.primary to
include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/google-beta" produced an invalid new value
for .node_pool_auto_config: block count changed from 0 to 1.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Steps to Reproduce
terraform planterraform apply
Important Factoids
References
- I believe this was introduced by https://github.com/GoogleCloudPlatform/magic-modules/pull/6133
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 19
- Comments: 19
Commits related to this issue
- downgrade to google prodiver 4.33.0 due to https://github.com/hashicorp/terraform-provider-google/issues/12422 — committed to TakeoffTech/netbox-gcp-deployment by scheuk 2 years ago
4.38.0 has been released, and the issue still persists on both
node_pool_defaultsandnode_pool_auto_config. This has not been resolvedApply output:
Thanks for the feedback! I was able to reproduce this error locally and Iβm working on a fix now.
Glad itβs solved! Thanks for the update!
Agree with @thameezb. I have the same issue on the latest release i-e
4.38.0on bothnode_pool_defaultsandnode_pool_auto_config. The block count changed without having it specified.The PR has not been merged and released yet. You could try to pin the provider version to 4.33.0 to prevent issues in the short term until the fix is released. The PR is targeting the next release.
@shuyama1 can you take a look at this?
The provider needs to be fixed, but as a work around we added this to our GKE module: