Skip to content

Commit

Permalink
Backport of Update docs to clarify cross-type moves into v1.8 (#34952)
Browse files Browse the repository at this point in the history
* backport of commit 99d7c43

* backport of commit 452bf81

---------

Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
  • Loading branch information
teamterraform and liamcervante committed Apr 5, 2024
1 parent 7ea68cf commit 943dd56
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions website/docs/language/modules/develop/refactoring.mdx
Expand Up @@ -103,11 +103,13 @@ so Terraform recognizes the move for all instances of the resource. That is,
it covers both `aws_instance.a[0]` and `aws_instance.a[1]` without the need
to identify each one separately.

Each resource type has a separate schema and so objects of different types
are not compatible. Therefore, although you can use `moved` to change the name
of a resource, you _cannot_ use `moved` to change to a different resource type
or to change a managed resource (a `resource` block) into a data resource
(a `data` block).
Each resource type has a separate schema so objects of different types
are not typically compatible. You can always use the `moved` block to change
the name of a resource, but some providers also let you change an object from
one resource type to another. Refer to the provider documentation for details
on which resources can move between types. You _cannot_ use the `moved`
block to change a managed resource (a `resource` block) into a data
resource (a `data` block).

## Enabling `count` or `for_each` For a Resource

Expand Down

0 comments on commit 943dd56

Please sign in to comment.