I'm currently working on an fully managed by Terraform environment but I reached some limitations and I would like to know if there is a feature or a workaround to do what I want :
(我目前正在一个完全由Terraform环境管理的工作中,但是遇到了一些限制,我想知道是否有某个功能或解决方法可以实现我想要的功能:)
I have an environment described like that :
(我有一个这样描述的环境:)
Everything work, but when I want to do a full clean up by running terraform destroy
I have to destroy some resources one by one with -target
option and then delete manually some references in the state file.
(一切正常,但是当我想通过运行terraform destroy
进行彻底清理时,必须使用-target
选项逐个销毁一些资源,然后手动删除状态文件中的某些引用。)
Two reasons why I would like to do that:
(我想这样做的两个原因:)
Just because it fails
(只是因为失败)
Don't know why, but I was unable to destroy with Terraform and manually some subnets (imposible to detach the internet gateway) but I was able to destroy them by simply destroying the VPC.
(不知道为什么,但是我无法使用Terraform手动销毁某些子网(无法分离Internet网关),但是我能够通过销毁VPC销毁它们。)
In this case, I would like to tell to Terraform to only delete the VPC, by doing that, AWS automatically destroy related components such as Subnets, Internet Gateway, Route table, Networks ACL, etc.
(在这种情况下,我想告诉Terraform仅删除VPC,这样做,AWS会自动销毁相关组件,例如子网,Internet网关,路由表,网络ACL等。)
Because it would be faster
(因为这样会更快)
I'm using Terraform with Kubernetes (and Helm) provider to define my Kubernetes configuration, but when I run terraform destroy
it will delete all the Kubernetes resources, then the Cluster (and workers).
(我正在使用带有Kubernetes(和Helm)提供程序的Terraform来定义我的Kubernetes配置,但是当我运行terraform destroy
,它将删除所有Kubernetes资源,然后是集群(和工作程序)。)
Only deleting the Cluster would be really faster.
(仅删除群集会更快。)
So here is my question : Is it possible to exclude resources to the destroy process in the Terraform configuration files ?
(所以这是我的问题: 是否可以在Terraform配置文件中排除破坏进程的资源?)
ask by Martin Paucot translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…