hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.53k stars 9.52k forks source link

terraform crashing with rancher2 provider after adding cloud_provider config #21753

Closed richardmosquera closed 5 years ago

richardmosquera commented 5 years ago

Terraform Version

Terraform v0.12.2
+ provider.rancher2 v1.1.0

Terraform Configuration Files

resource "rancher2_cluster" "ld-nms" {
  name        = "ld-nms"
  description = "ld-nms cluster"

  rke_config {
    network {
      plugin = "canal"
    }

    cloud_provider {
      vsphere_cloud_provider {
        global {
          insecure_flag = true
        }

        virtual_center {
          name        = "<ip.address>"
          user        = "${var.vsphere_username}"
          password    = "${var.vsphere_password}"
          datacenters = "<DATACENTER>"
        }

        workspace {
          server            = "<ip.address>>"
          folder            = "kubernetes"
          default_datastore = "<CLUSTER>/<DATASTORE>"
          datacenter        = "<DATACENTER>"
        }
      }
    }
  }
}

Debug Output

https://gist.github.com/richardmosquera/b365f3fe064c4a37ef82acc60bd3b415

Crash Output

https://gist.github.com/richardmosquera/4424ef0ebf713b758bf1a2b33770caa2

Expected Behavior

Cloud provider should have been added to the cluster config.

Actual Behavior

Terraform crashed

Steps to Reproduce

Everything was working fine, terraform plan reported no changes. Crashes started happening when I added the cloud_config. However, even after removing it, it still crashed.

  1. terraform plan (0 changes)
  2. add cloud provider config as above
  3. terraform plan
  4. crash

Additional Context

To get terraform to not crash I had to delete the ld-nms cluster.

This is also not the first time it has happened. I've seen the same behavior with other resources.

References

ghost commented 5 years ago

This issue has been automatically migrated to terraform-providers/terraform-provider-rancher2#34 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to terraform-providers/terraform-provider-rancher2#34.

ghost commented 5 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 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.