terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
Kubernetes API get '404 NOT Found' when checking the existing resources
Kubernetes API can not get existing resources when checking terraform state file, and then it want to recreate some resources
- I apply my terraform scripts in my local computer and save the state file to Ali cloud OSS
- I trigger the terraform init, plan in Github action using the same state file, then terraform want to recreate some of existing resources
When I check the log in terraform, I found Terraform provider can not find some part of existing resources saying '404 Not Found'
But some resources not, without errors
Terraform Version, Provider Version and Kubernetes Version
Terraform v1.6.5
on darwin_amd64
+ provider registry.terraform.io/aliyun/alicloud v1.207.0
+ provider registry.terraform.io/hashicorp/alicloud v1.213.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.24.0
Affected Resource(s)
- kubernetes_limit_range
- kubernetes_cluster_role_binding_v1
- kubernetes_role_binding
Debug Output
Terraform log in Github action could be found here.
https://gist.github.com/Duanjax/dd693b8acb200e5c156a65c100f49e61
Steps to Reproduce
terraform apply--> create some Kubernetes resources in local device- trigger github aciton
terraform planuse the same state file
Expected Behavior
NO Changes
It should be no changes here.
Actual Behavior
Plan: 4 to add, 0 to change, 0 to destroy.
It want to recreate some existing resources.