You are updating an ECS task definition that requires destroying the old task first. The service must have zero downtime. Which lifecycle setting achieves this?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: `create_before_destroy = true`

`create_before_destroy = true` tells Terraform to provision the new resource before destroying the old one. This is the standard pattern for zero-downtime replacements (blue/green ...

Real Exam Scenario

You are updating an ECS task definition that requires destroying the old task first. The service must have zero downtime. Which lifecycle setting achieves this?

✓ Correct Answer & Explanation

Correct Answer

`create_before_destroy = true`

Why This Answer Is Correct

`create_before_destroy = true` tells Terraform to provision the new resource before destroying the old one. This is the standard pattern for zero-downtime replacements (blue/green style). `ignore_changes` would suppress updates entirely. `replace_triggered_by` forces replacement when another resource changes, but doesn't control creation order on its own.