Courseiva
Resource Lifecycle ManagementhardMultiple ChoiceObjective-mapped

AWS provider Resource Lifecycle Management Practice Question

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?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use replace_triggered_by = [aws_s3_object.lambda_code.key]

The replace_triggered_by meta-argument allows forcing a resource to be replaced when another specified resource or attribute changes.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use lifecycle { force_replace = true }

    Why it's wrong here

    This is not a valid lifecycle meta-argument.

  • Use replace_triggered_by = [aws_s3_object.lambda_code.key]

    Why this is correct

    This correctly references the attribute change to trigger replacement.

  • Use create_before_destroy.

    Why it's wrong here

    This only controls the timing, not the trigger for replacement.

  • Use ignore_changes = [source_code_hash]

    Why it's wrong here

    This would prevent Terraform from detecting code changes.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 193 original AWS provider practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official HashiCorp exam blueprint

This AWS provider practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AWS provider exam.