当删除GCP项目时,Terraform状态文件中关联对象会发生什么

发布于 2025-02-06 08:57:47 字数 468 浏览 5 评论 0原文

需要帮助了解Terraform状态文件行为。

我正在从事一个GCP项目。我们有多个与项目关联的对象,例如GKE群集,redis等。所有这些相关的对象都有其自己的Terraform状态文件。我们已经手动删除了GCP项目。关联对象会发生什么?它们也会被删除吗?

  1. 如果关联对象(GKE群集,redis等)也与GCP项目一起删除,那么我如何在Terraform状态文件中更新所有这些手动删除资源?

  2. 如果未删除关联对象,则如何使用Terraform配置文件删除资源,而没有GCP ProjectID ??

  3. 如果我将来再次创建同一GCP项目,因为我手动删除了该项目,它是否会出现任何错误?还是它只是重新创建它?

  4. 最后,由于我们手动删除了GCP项目,如果我只是忽略了更新关联对象的状态文件,Terraform将允许我再次创建相同的GCP项目和关联的对象?

Need help in understanding the terraform state file behavior.

I am working on a gcp project. We have multiple objects like gke cluster,redis etc., associated with the project. And all of these associated objects have their own terraform state files. We have manually deleted the gcp project. What will happen to the associated objects? Will they be deleted as well?

  1. If the associated objects(gke cluster, redis etc.,) also gets deleted along with the gcp project, then how can I update all these manually deleted resources in terraform state file?

  2. If the associated objects are not deleted, then how can I delete the resources using terraform config files without the gcp projectId??

  3. If I create the same gcp project again in future, will it throw any error saying the projectId is already present since I deleted it manually?? or will it just recreate it??

  4. Finally, since we have deleted the gcp project manually, if I just ignore updating the state files of the associated objects, will terraform allow me to create the same gcp project and associated objects again?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文