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 cannot update cluster as no_subnet is null #1360

Closed
ghost opened this issue Apr 23, 2020 · 2 comments
Closed

terraform cannot update cluster as no_subnet is null #1360

ghost opened this issue Apr 23, 2020 · 2 comments
Assignees

Comments

@ghost
Copy link

ghost commented Apr 23, 2020

Hello, I am trying to move management of existing clusters to Terraform and am running into issues (potentially where they are old clusters).

I am doing terraform import ibm_container_cluster.cluster <clusterid> where the resource is defined as follows:

resource "ibm_container_cluster" "cluster" {
  name              = var.cluster_name
  datacenter        = ""
  default_pool_size = var.pool_size
  hardware          = var.hardware
  machine_type      = var.machine_type
  public_vlan_id    = var.public_vlan_id
  private_vlan_id   = var.private_vlan_id
  kube_version      = var.kube_version
}

which fetches the state of my cluster and stores in the .tfstate file. However, no matter what when I run terraform plan -var-file=<tfvarfile> it always says it will destroy and recreate my cluster (which I really dont want as I would want to migrate some production clusters to the same).

The problem appears to be the no_subnet property. The tfstate file shows the cluster as having it set to null, but I am unable to define null in the resource above as it will default to false (causing a force replacement) or if I set to true (causes a force replacement). Is there any way around this?

Terraform Version

terraform -v
Terraform v0.12.24
+ provider.ibm v1.4.0

Affected Resource(s)

Please list the resources as a list, for example:

  • ibm_container_cluster

Expected Behavior

What should have happened?

No difference between plans

Actual Behavior

What actually happened?

will destroy and force create a new cluster

Important Factoids

  • This is a cluster created in 2018, so may have differences between old and new clusters created in IKS

References

N/A

@hkantare
Copy link
Collaborator

As a temporary workaround can you set the no_subnet to fasle in tf.state..We will look into the issue

@hkantare
Copy link
Collaborator

Fixed in latest releases..Imports works as expected
https://github.com/IBM-Cloud/terraform-provider-ibm/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants