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

[Feature] - Support import for vultr_kubernetes and vultr_kubernetes_node_pools #310

Open
jtackaberry opened this issue Jan 2, 2023 · 2 comments
Assignees

Comments

@jtackaberry
Copy link

Currently existing VKE clusters and node pools can't be imported into state. This feature request is just to provide some means of importing these existing resources.

@optik-aper
Copy link
Member

@jtackaberry Thanks for the issue. I'll spend some time testing this out and see what we can do.

@optik-aper optik-aper self-assigned this Jan 24, 2023
@Stealthmate
Copy link

I think I just ran into this issue. First, I tried the obvious thing:

terraform import vultr_kuberenets.my_cluster <uuid copied from browser URL>

This was successful, but then after I ran terraform plan, it started complaining that the cluster must be replaced. Upon further inspection, I found out that some fields in the state file were null, even though they should have values. In my case, those were:

  • region
  • label
  • enable_firewall

There might be others as well. I tried digging around in the source code, and found this: https://github.com/vultr/terraform-provider-vultr/blob/master/vultr/resource_vultr_kubernetes.go#L155 . I'm not familiar with the Terraform Provider SDK, but it seems to me that resourceVultrKubernetesRead is not reading all fields, which leads to terraform import saving null values. @optik-aper If my train of thought is correct, let me know and I'll push a PR to deal with the 3 fields above!

FYI, I solved my problem by manually editing the state file and setting the fields as needed. But obviously this is a dirty hack, so think thrice before trying it.

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

No branches or pull requests

3 participants