Terraform destroy-一种排除动态表的方法

问题描述 投票:0回答:1

terraform destroy时可以排除via terraform创建的dynamodb表吗?想要避免删除现有表

amazon-web-services amazon-dynamodb terraform devops
1个回答
0
投票

当然,可以通过将lifecycle块与prevent_destroy元参数(docs)结合使用来实现该行为。例如:

resource "aws_dynamodb_table" "my-dynamodb-table" {
  # configs...
  lifecycle {
    prevent_destroy = true
  }
}

生命周期块可用于所有resource块。

© www.soinside.com 2019 - 2024. All rights reserved.