hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.6k stars 979 forks source link

Support for `moved` blocks between version-suffixed and non-suffixed resource types #2540

Open sybereal opened 4 months ago

sybereal commented 4 months ago

Description

Terraform 1.8.0 added support for moved blocks in which the source and destination resource types differ. This support, however, depends on the provider declaring support for this operation. The request is for the Kubernetes Terraform provider to support use of moved blocks to convert, e.g., kubernetes_deployment resources to kubernetes_deployment_v1.

Potential Terraform Configuration

# old.tf
resource "kubernetes_deployment" "my_deployment" {
  ...
}

# new.tf
resource "kubernetes_deployment_v1" "my_deployment" {
  ...
}

moved {
  from = kubernetes_deployment.my_deployment
  to   = kubernetes_deployment_v1.my_deployment
}

References

2301 was closed, but at the time, Terraform support for cross-resource-type moved blocks did not exist yet.

Community Note