Complete the code to add a lifecycle block that prevents resource destruction.
resource "aws_s3_bucket" "example" { bucket = "my-example-bucket" lifecycle { [1] = true } }
The prevent_destroy lifecycle rule stops Terraform from deleting the resource.
Complete the lifecycle block to prevent destroying the resource.
lifecycle {
[1] = true
}Setting prevent_destroy = true in the lifecycle block prevents resource deletion.
Fix the error in the lifecycle block to correctly prevent resource destruction.
lifecycle {
prevent_destroy = [1]
}The value must be the boolean true without quotes to enable prevent_destroy.
Fill both blanks to add a lifecycle block that prevents destroying and ignores changes to tags.
lifecycle {
[1] = true
[2] = ["tags"]
}prevent_destroy = true stops deletion, and ignore_changes = ["tags"] ignores tag updates.
Fill all three blanks to add a lifecycle block that prevents destroying, creates before destroy, and ignores changes to tags.
lifecycle {
[1] = true
[2] = true
[3] = ["tags"]
}This lifecycle block prevents resource destruction, ensures new resource creation before old one is destroyed, and ignores changes to tags.