【问题标题】:Terraform aws - Will changing the module for creating s3 bucket of same name delete the s3 bucket and re-create itTerraform aws - 将更改用于创建同名 s3 存储桶的模块删除 s3 存储桶并重新创建它
【发布时间】:2021-05-25 14:13:38
【问题描述】:

使用 terraform,我使用模块在 aws“sample-s3”中创建了一个 s3 存储桶。

一段时间后,我决定更改用于创建 s3 存储桶的模块。但不应删除并重新创建现有的 s3 存储桶。那可能吗?有人可以帮帮我吗?

【问题讨论】:

  • 您是否有任何可重现的示例来说明您的代码和要进行的更改?

标签: amazon-web-services amazon-s3 terraform-provider-aws


【解决方案1】:

您可以使用 terraform state rm 命令从 terraform state 中删除该 s3 存储桶,然后在更改模块后使用新结构导入。

【讨论】:

  • 感谢您的建议。让我试试这个。目前,我还没有删除旧模块,保持这两个模块似乎工作正常。虽然代码看起来多余
猜你喜欢
  • 2021-02-22
  • 2020-05-26
  • 1970-01-01
  • 2021-08-14
  • 2021-12-11
  • 2020-05-04
  • 2020-07-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多