Recall & Review
beginner
What is lifecycle customization in Terraform?
It is a way to control how Terraform creates, updates, or deletes resources by setting special rules inside the resource block.
Click to reveal answer
beginner
What does the
prevent_destroy lifecycle argument do?It stops Terraform from deleting a resource, even if you run a destroy command or remove it from the config.
Click to reveal answer
intermediate
Explain the purpose of
ignore_changes in lifecycle customization.It tells Terraform to ignore changes to specified resource attributes so they won't trigger updates.
Click to reveal answer
intermediate
How does
create_before_destroy affect resource updates?Terraform creates the new resource first before deleting the old one to avoid downtime.
Click to reveal answer
beginner
Give an example use case for lifecycle customization in Terraform.
Protecting a database instance from accidental deletion by using
prevent_destroy.Click to reveal answer
Which lifecycle argument prevents Terraform from deleting a resource?
✗ Incorrect
prevent_destroy stops deletion of a resource.
What does
ignore_changes do in Terraform lifecycle?✗ Incorrect
ignore_changes tells Terraform to skip updates for certain attributes.
Why use
create_before_destroy in lifecycle?✗ Incorrect
This avoids downtime by creating the new resource first.
Which lifecycle argument helps avoid accidental resource deletion?
✗ Incorrect
prevent_destroy protects resources from deletion.
Can lifecycle customization affect resource update behavior?
✗ Incorrect
Lifecycle can control updates by ignoring changes or ordering.
Describe the main lifecycle customization options in Terraform and their effects.
Think about how Terraform handles create, update, and delete actions.
You got /3 concepts.
Explain a scenario where you would use lifecycle customization to protect a resource.
Consider resources that are costly or risky to lose.
You got /3 concepts.