TERRAFORM-ASSOCIATE-004 · Question #242
TERRAFORM-ASSOCIATE-004 Question #242: Real Exam Question with Answer & Explanation
The correct answer is A: moved {. Terraform does not automatically update state references when resource identifiers are renamed. Instead, you must use a moved block in your configuration to inform Terraform how to map the old resource to the new one. This prevents Terraform from destroying and recreating the
Question
You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource? Original configuration: resource "aws_s3_bucket" "photoes" { bucket_prefix = "images" } Updated configuration: resource "aws_s3_bucket" "photos" { bucket_prefix = "images" }
Options
- Amoved {
- Bmoved {
- Cmoved {
- DNone. Terraform will automatically update the resource ID.
Explanation
Terraform does not automatically update state references when resource identifiers are renamed. Instead, you must use a moved block in your configuration to inform Terraform how to map the old resource to the new one. This prevents Terraform from destroying and recreating the
Topics
Community Discussion
No community discussion yet for this question.