Closed alexandrujieanu closed 2 months ago
This helped, but I think the provider should not error like that.
terraform state rm module.eks.kubernetes_config_map_v1_data.aws_auth[0]
Removed module.eks.kubernetes_config_map_v1_data.aws_auth[0]
Successfully removed 1 resource instance(s).
I am facing the same situation when i trigger my pipeline, in order to destroy the kubernetes objects from EKS cluster:
Error: Kubernetes Client kubernetes client initialization failed: the server has asked for the client to provide credentials. Error: configmaps "aws-auth" is forbidden: User "system:serviceaccount:default:default" cannot delete resource "configmaps" in API group "" in the namespace "kube-system"
The strange behaviour is that when i`m creating or updating the kubernetes objects, the kubernetes provider does not complain that can not authenticate to EKS I did the same workaround as you @alexandrujieanu, but it is ugly to delete all the k8s objects from terraform state
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Deleted AWS EKS cluster
Terraform Configuration Files
eks.tf
providers.tf
locals.tf
Debug Output
https://gist.github.com/alexandrujieanu/317f94b035d1d6a47ae463211da00e05
Panic Output
n/a
Steps to Reproduce
terraform-aws-modules
v19.10.0.Expected Behavior
Terraform should have detected that the EKS cluster was deleted and plan to recreated.
Actual Behavior
Terraform plan/apply/destroy errors.
Important Factoids
n/a
References
n/a
Community Note