Posted on 9 September 2020, updated on 14 February 2022.
This article deals with moving Terraform resources in the Terraform state. First, we will see how we can change a resource name, move a resource between different Terraform objects (“for_each”, “count” and simple resources). Then, we will see a way for migrating a resource from a workspace to another Terraform workspace. In this article, we will work with an AWS S3 bucket but it is just an example, you can do it with any other resource in Terraform.