QuestionQ35

VerifiedTerraform state management

You fixed a typo in a resource name, changing it from aws_s3_bucket.photoes to aws_s3_bucket.photos. You need to update the Terraform state so the existing resource is recognized by its new name, without destroying and recreating it.

Which configuration should you use?

Explanation

A Terraform moved block declares the resource’s prior and new addresses. Terraform checks state for the from address and records the same existing object at the to address, so the rename does not require destroying and recreating the bucket.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!