Recall & Review
beginner
What does the
create_before_destroy lifecycle rule do in Terraform?It tells Terraform to create the new resource before destroying the old one, helping to avoid downtime during updates.
Click to reveal answer
beginner
Why is
create_before_destroy useful for resources like load balancers or instances?Because it ensures the new resource is ready before the old one is removed, preventing service interruptions.
Click to reveal answer
beginner
How do you enable
create_before_destroy in a Terraform resource block?By adding a
lifecycle block with create_before_destroy = true inside the resource definition.Click to reveal answer
intermediate
What happens if
create_before_destroy is not set and a resource needs replacement?Terraform destroys the old resource first, which can cause downtime or service disruption.
Click to reveal answer
intermediate
Can
create_before_destroy be used with all Terraform resources?No, some resources do not support it due to provider or resource limitations.
Click to reveal answer
What is the main benefit of using
create_before_destroy in Terraform?✗ Incorrect
The
create_before_destroy rule ensures the new resource is created first, preventing downtime.Where do you place the
create_before_destroy setting in Terraform?✗ Incorrect
It must be set inside the
lifecycle block within a resource.What might happen if you don't use
create_before_destroy for a critical resource update?✗ Incorrect
Without
create_before_destroy, the old resource is removed first, which can cause downtime.Is
create_before_destroy always supported by all Terraform providers?✗ Incorrect
Support depends on the provider and resource capabilities.
Which of these is a correct example of enabling
create_before_destroy?✗ Incorrect
The
create_before_destroy setting must be inside the lifecycle block within the resource.Explain how the
create_before_destroy lifecycle rule helps prevent downtime during resource updates in Terraform.Think about what happens when replacing a resource without this rule.
You got /3 concepts.
Describe where and how to configure the
create_before_destroy rule in a Terraform resource.Look for the lifecycle settings inside the resource.
You got /3 concepts.