hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.31k stars 1.73k forks source link

Terraform apply with GCS Bucket remote state and node upgrade doesn't seem to work #223

Closed hashibot closed 7 years ago

hashibot commented 7 years ago

This issue was originally opened by @Stono as hashicorp/terraform#15601. It was migrated here as a result of the provider split. The original body of the issue is below.


Hi, This is a bit of both root terraform, and provider (google) so posting it here.

Terraform Version

[root@infra preprod]# terraform -v
2017/07/20 11:58:36 [INFO] Terraform version: 0.9.11  efca455c35d0d218a9bfee835a8ec3ef8d4d1c8c
2017/07/20 11:58:36 [INFO] Go runtime version: go1.8
2017/07/20 11:58:36 [INFO] CLI args: []string{"/usr/local/bin/terraform", "-v"}
2017/07/20 11:58:36 [DEBUG] Detected home directory from env var: /root
2017/07/20 11:58:36 [INFO] CLI command args: []string{"version", "-v"}
Terraform v0.9.11

Terraform Configuration Files

Too many, and too complex to paste. But in this example - we're doing a simple kubernetes version upgrade using the google_container_cluster resource.

Debug Output

[root@infra preprod]# terraform apply /app/tmp/preprod.plan
2017/07/20 11:56:56 [INFO] Terraform version: 0.9.11  efca455c35d0d218a9bfee835a8ec3ef8d4d1c8c
2017/07/20 11:56:56 [INFO] Go runtime version: go1.8
2017/07/20 11:56:56 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "/app/tmp/preprod.plan"}
2017/07/20 11:56:56 [DEBUG] Detected home directory from env var: /root
2017/07/20 11:56:56 [INFO] CLI command args: []string{"apply", "/app/tmp/preprod.plan"}
2017/07/20 11:56:56 [INFO] command: initializing backend from plan: gcs
2017/07/20 11:56:56 [INFO] Authenticating using DefaultClient
2017/07/20 11:56:56 [INFO] Instantiating Google Storage Client...
2017/07/20 11:56:56 [INFO] Reading peopledata-product-team-terraform/preprod/terraform.tfstate
2017/07/20 11:56:56 [INFO] Downloaded 25630 bytes
2017/07/20 11:56:56 [INFO] Writing peopledata-product-team-terraform/preprod/terraform.tfstate
2017/07/20 11:56:57 [INFO] command: backend initialized: *legacy.Backend
2017/07/20 11:56:57 [INFO] command: backend *legacy.Backend is not enhanced, wrapping in local
2017/07/20 11:56:57 [INFO] backend/local: starting Apply operation
2017/07/20 11:56:57 [INFO] Reading peopledata-product-team-terraform/preprod/terraform.tfstate
2017/07/20 11:56:57 [INFO] Downloaded 25630 bytes
2017/07/20 11:56:57 [INFO] terraform: building graph: GraphTypeApply
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.vpn_tunnel_peerip" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.vpn_dest_range" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.vpn_static_ip" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.vpn_tunnel_secret" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.container_cidr_range" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.module.network.var.cluster_ip_range" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.var.vpn_tunnel_secret" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.var.vpn_static_ip" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.var.cluster_ip_range" in graph, nothing depends on it
2017/07/20 11:56:57 [INFO] Not including "module.container.var.dns" in graph, nothing depends on it
e.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.provider.google - *terraform.NodeApplyableProvider
  provider.google (disabled) - *terraform.NodeDisabledProvider
module.container.var.cluster_password - *terraform.NodeApplyableModuleVariable
  var.preprod_cluster_password - *terraform.NodeRootVariable
module.container.var.cluster_username - *terraform.NodeApplyableModuleVariable
module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
module.container.var.env - *terraform.NodeApplyableModuleVariable
provider.google (disabled) - *terraform.NodeDisabledProvider
var.preprod_cluster_password - *terraform.NodeRootVariable
var.vpn_tunnel_secret - *terraform.NodeRootVariable
ork.var.env - *terraform.NodeApplyableModuleVariable
  module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.provider.google - *terraform.NodeApplyableProvider
  provider.google (disabled) - *terraform.NodeDisabledProvider
module.container.var.cluster_password - *terraform.NodeApplyableModuleVariable
  var.preprod_cluster_password - *terraform.NodeRootVariable
module.container.var.cluster_username - *terraform.NodeApplyableModuleVariable
module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
module.container.var.env - *terraform.NodeApplyableModuleVariable
provider.google (disabled) - *terraform.NodeDisabledProvider
var.preprod_cluster_password - *terraform.NodeRootVariable
var.vpn_tunnel_secret - *terraform.NodeRootVariable
rraform.NodeApplyableModuleVariable
  module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
  provider.google (disabled) - *terraform.NodeDisabledProvider
  var.preprod_cluster_password - *terraform.NodeRootVariable
  var.vpn_tunnel_secret - *terraform.NodeRootVariable
module.container.google_container_cluster.cluster - *terraform.NodeApplyableResource
  module.container.module.network.output.name - *terraform.NodeApplyableOutput
  module.container.module.network.output.subnet_name - *terraform.NodeApplyableOutput
  module.container.provider.google - *terraform.NodeApplyableProvider
  module.container.var.cluster_password - *terraform.NodeApplyableModuleVariable
  module.container.var.cluster_username - *terraform.NodeApplyableModuleVariable
  module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.output.name - *terraform.NodeApplyableOutput
  module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.output.subnet_name - *terraform.NodeApplyableOutput
  module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.provider.google - *terraform.NodeApplyableProvider
  provider.google (disabled) - *terraform.NodeDisabledProvider
module.container.var.cluster_password - *terraform.NodeApplyableModuleVariable
  var.preprod_cluster_password - *terraform.NodeRootVariable
module.container.var.cluster_username - *terraform.NodeApplyableModuleVariable
module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
module.container.var.env - *terraform.NodeApplyableModuleVariable
provider.google (close) - *terraform.graphNodeCloseProvider
  module.container.google_container_cluster.cluster - *terraform.NodeApplyableResource
  provider.google (disabled) - *terraform.NodeDisabledProvider
provider.google (disabled) - *terraform.NodeDisabledProvider
var.preprod_cluster_password - *terraform.NodeRootVariable
var.vpn_tunnel_secret - *terraform.NodeRootVariable
.var.env - *terraform.NodeApplyableModuleVariable
  module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.env - *terraform.NodeApplyableModuleVariable
  module.container.var.env - *terraform.NodeApplyableModuleVariable
module.container.module.network.var.vpn_region - *terraform.NodeApplyableModuleVariable
module.container.provider.google - *terraform.NodeApplyableProvider
  provider.google (disabled) - *terraform.NodeDisabledProvider
module.container.var.cluster_password - *terraform.NodeApplyableModuleVariable
  var.preprod_cluster_password - *terraform.NodeRootVariable
module.container.var.cluster_username - *terraform.NodeApplyableModuleVariable
module.container.var.container_cidr_range - *terraform.NodeApplyableModuleVariable
module.container.var.env - *terraform.NodeApplyableModuleVariable
provider.google (close) - *terraform.graphNodeCloseProvider
  module.container.google_container_cluster.cluster - *terraform.NodeApplyableResource
  provider.google (disabled) - *terraform.NodeDisabledProvider
provider.google (disabled) - *terraform.NodeDisabledProvider
root - terraform.graphNodeRoot
  meta.count-boundary (count boundary fixup) - *terraform.NodeCountBoundary
  provider.google (close) - *terraform.graphNodeCloseProvider
var.preprod_cluster_password - *terraform.NodeRootVariable
var.vpn_tunnel_secret - *terraform.NodeRootVariable
- *terraform.graphNodeCloseProvider
  module.container.google_container_cluster.cluster - *terraform.NodeApplyableResource
provider.google (disabled) - *terraform.NodeDisabledProvider
root - terraform.graphNodeRoot
  meta.count-boundary (count boundary fixup) - *terraform.NodeCountBoundary
  provider.google (close) - *terraform.graphNodeCloseProvider
var.preprod_cluster_password - *terraform.NodeRootVariable
var.vpn_tunnel_secret - *terraform.NodeRootVariable
module.container.google_container_cluster.cluster: Modifying... (ID: peopledata-preprod)
  node_version: "1.6.6" => "1.7.0"
module.container.google_container_cluster.cluster: Modifications complete (ID: peopledata-preprod)
2017/07/20 11:56:59 [INFO] Writing peopledata-product-team-terraform/preprod/terraform.tfstate

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.

State path:

Expected Behavior

Kubernetes to have been upgraded to 1.7.0 State file to have been updated to reflect 1.7.0 The "State Path" not to be null

Actual Behavior

Despite seeing "Apply complete! Resources: 0 added, 1 changed, 0 destroyed." Kubernetes remains on 1.6.6 State file in the gcloud bucket shows 1.6.6 State path is empty If I go and view the state file in GCS it was written (so its nothing permissions based) but shows 1.6.6

Stono commented 7 years ago

Please see my comments on the original issue

ghost commented 4 years ago

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!