[英]Deleted k8s cluster in aws dashboard and now terraform is erroring out
I created a k8s eks cluster and all of it's resources within terraform but ran into some issues and deleted the cluster through the aws UI.我在 terraform 中创建了一个 k8s eks 集群及其所有资源,但遇到了一些问题并通过 aws UI 删除了集群。 Now when I try to run terraform I'm getting this error
Error: Get "http://localhost/api/v1/persistentvolumes/efs-jupyter-shared-v2": dial tcp 127.0.0.1:80: connect: connection refused
for each of the resources.现在,当我尝试运行 terraform 时出现此错误
Error: Get "http://localhost/api/v1/persistentvolumes/efs-jupyter-shared-v2": dial tcp 127.0.0.1:80: connect: connection refused
对于每个资源。 I tried commenting out all of the resources within terraform and running, and still got the same error.我尝试注释掉 terraform 中的所有资源并运行,但仍然出现相同的错误。 Any ideas how to proceed?
任何想法如何进行?
You need to clean the terraform state:您需要清洁 terraform state:
First step is listing all the resources in the state:第一步是列出 state 中的所有资源:
terraform state list
Then you can delete the resources you deleted in AWS dashboard:然后您可以删除您在 AWS 控制面板中删除的资源:
terraform state rm <resource_name>
Finally you can run your terraform code to recreate the resources.最后,您可以运行 terraform 代码来重新创建资源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.