QuestionQ93

Terraform configuration

Your Terraform configuration manages a resource that requires maximum uptime. You need to update the resource, and when you run terraform plan, Terraform indicates that the update requires the resource to be destroyed and recreated.

Which lifecycle rule can you add to the resource to reduce its downtime while still applying the update?

  • A prevent_destroy = true
  • B destroy = false
  • C create_before_destroy = true
  • D ignore_changes = all
Explanation

Setting create_before_destroy = true instructs Terraform to create the replacement resource before it destroys the current one. This changes a forced replacement from destroy-then-create to create-then-destroy, reducing potential service downtime, subject to provider constraints such as unique-name requirements.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!