Courseiva

AWS provider · topic practice

Resource Lifecycle Management practice questions

This domain covers how Terraform creates, updates, replaces, and destroys real infrastructure, including taint, lifecycle meta-arguments, and state-driven replacement behavior. On the AWS provider exam you reason about apply plans, prevent_destroy, create_before_destroy, and how state and configuration drift trigger destroy-and-recreate of resources like RDS instances.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Resource Lifecycle Management

What the exam tests

What to know about Resource Lifecycle Management

Be able to predict whether terraform apply updates in place or destroys and recreates a resource, and to control that with taint, -replace, and lifecycle blocks. The key skill is reading the plan and knowing prevent_destroy only guards against destroy, not state removal.

Taint semantics: terraform taint and terraform apply -replace force destroy-and-recreate on next apply.

Lifecycle meta-arguments: prevent_destroy, create_before_destroy, ignore_changes, and replace_triggered_by behavior.

Reading terraform plan output to distinguish in-place update from destroy-and-recreate for AWS resources.

State management commands: terraform state rm, mv, and import to control resource lifecycle tracking.

Watch out for

Common Resource Lifecycle Management exam traps

  • ▸Assuming prevent_destroy blocks all deletion; it only blocks destroy plans, and terraform state rm removes tracking without deleting the real resource.
  • ▸Forgetting that changing a ForceNew attribute on an AWS resource, such as an RDS identifier or subnet group, silently plans a destroy-and-recreate.
  • ▸Believing taint is permanent or that apply clears it without recreating; the tainted resource is destroyed and recreated on the next apply.

Practice set

Resource Lifecycle Management questions

20 questions · select your answer, then reveal the explanation

You need to ensure that an AWS Auto Scaling Group maintains capacity during a configuration change that requires a new launch template. Which lifecycle meta-argument should you use?

You have an AWS Lambda function that should be replaced whenever the source code S3 object changes. How do you trigger this replacement specifically based on the S3 object key change?

What is the purpose of the 'terraform state refresh' command?

You need to ignore changes to a specific index in a list of security group rules. How is this formatted in 'ignore_changes'?

Which meta-argument is used to prevent a resource from being replaced when its configuration changes?

When using 'replace_triggered_by', what happens if the referenced resource is deleted?

Which THREE of the following are valid lifecycle meta-arguments?

Which THREE of these are reasons to use the 'ignore_changes' lifecycle meta-argument?

Question 9mediummultiple choice
Review the full subnetting walkthrough →

You manage an AWS RDS instance with Terraform. The DB subnet group attached to the instance must be replaced whenever the underlying private subnets change, but you want to avoid unnecessary replacements when only the RDS instance's own attributes change. Which lifecycle meta-argument should you use to trigger replacement based on the subnet IDs?

You manage an AWS RDS instance in Terraform. A new security policy requires that the instance's storage be encrypted. You modify the Terraform configuration to set `storage_encrypted = true` and run `terraform apply`. The apply fails with an error indicating that the attribute cannot be modified. What is the most likely cause and correct action?

You are using Terraform to manage an Auto Scaling group (ASG) and its launch configuration. The launch configuration is immutable, so any change to its attributes requires a new launch configuration and an update to the ASG. You want to ensure that the ASG is updated to use the new launch configuration without downtime. Which two lifecycle meta-arguments should you use together to achieve this? (Choose two.)

You manage an AWS RDS instance defined with the aws_db_instance resource. A junior engineer manually changed the instance class via the AWS CLI. Your team wants the next terraform apply to revert this change automatically, but you also want to avoid Terraform trying to modify the storage_type attribute because it is managed by a separate automation. Which configuration should you use in the lifecycle block of the aws_db_instance resource?

You have an AWS Auto Scaling group managed by Terraform. A lifecycle hook is configured to keep instances in a terminating:wait state. You need Terraform to destroy the group and its instances without hanging indefinitely, but you must still allow the hook to run for normal scaling events. What should you configure?

You have a Terraform configuration that manages an AWS Auto Scaling group. You need to ensure that the group is replaced only when a specific launch template version changes, but not when other attributes change. Which approach achieves this?

Question 15mediummultiple choice
Review the full routing breakdown →

A platform team manages an aws_db_instance with lifecycle { create_before_destroy = true } in its resource block. During a routine apply, Terraform must replace the database because an immutable attribute changed. The team observes that the new instance is created before the old one is destroyed, but the apply then fails when Terraform attempts to modify a dependent aws_route53_record. What is the most likely cause of this failure?

You manage an Amazon RDS DB instance declared with the aws_db_instance resource. Your team's compliance policy requires that the production database can never be destroyed by a terraform apply, but developers still need to be able to run terraform destroy on ephemeral staging stacks from the same configuration. Which approach best satisfies this requirement?

You are using Terraform to manage an AWS S3 bucket. You need to ensure that the bucket is not destroyed by a `terraform destroy` command, and you also want to prevent accidental deletion if the resource is removed from the configuration. Which two actions should you take? (Choose two.)

You are managing a fleet of `aws_instance` resources with Terraform. You want a specific instance to be replaced whenever the value of an `aws_ami` data source changes, without changing any other attribute of the instance. Which two actions are required to achieve this? (Choose two.)

You are managing a set of AWS resources with Terraform, including an S3 bucket and an S3 bucket policy. The bucket policy depends on the bucket's ARN. You need to ensure that whenever the bucket's ARN changes, the bucket policy is replaced. However, you also want to avoid unnecessary replacements if other attributes of the bucket change. Which configuration should you use for the aws_s3_bucket_policy resource?

You are using Terraform to manage an AWS S3 bucket and its objects. You need to ensure that the bucket is not destroyed if it contains objects, but you also want to allow Terraform to delete individual objects when they are removed from configuration. Which TWO configurations should you implement? (Choose two.)

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Resource Lifecycle Management sessions

Start a Resource Lifecycle Management only practice session

Every question in these sessions is drawn from the Resource Lifecycle Management domain — nothing else.

Related practice questions

Related AWS provider topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the AWS provider exam test about Resource Lifecycle Management?
Be able to predict whether terraform apply updates in place or destroys and recreates a resource, and to control that with taint, -replace, and lifecycle blocks. The key skill is reading the plan and knowing prevent_destroy only guards against destroy, not state removal.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Resource Lifecycle Management questions in a focused session?
Yes — the session launcher on this page draws every question from the Resource Lifecycle Management domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other AWS provider topics?
Use the topic links above to move to related areas, or go back to the AWS provider question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the AWS provider exam covers. They are not copied from any real exam or dump site.