Update note and add learn call out

This commit is contained in:
Laura Pacilio 2021-12-07 17:09:13 -05:00
parent fc7358611c
commit 529a2c34df
1 changed files with 7 additions and 8 deletions

View File

@ -8,12 +8,9 @@ description: |-
# Refactoring # Refactoring
~> **Note:** Explicit refactoring declarations with `moved` blocks will work -> **Note:** Explicit refactoring declarations with `moved` blocks is available in Terraform v1.1 and later. For earlier Terraform versions or for refactoring actions too complex to express as `moved` blocks, you can
only in Terraform v1.1 and later. When working with earlier Terraform versions, use the [`terraform state mv` CLI command](/docs/cli/commands/state/mv.html)
or for refactoring actions too complex to express as `moved` blocks, you could as a separate step.
use
[the `terraform state mv` CLI command](/docs/cli/commands/state/mv.html)
as a separate step instead.
In shared modules and long-lived configurations, you may eventually outgrow In shared modules and long-lived configurations, you may eventually outgrow
your initial module structure and resource names. For example, you might decide your initial module structure and resource names. For example, you might decide
@ -29,6 +26,8 @@ When you add `moved` blocks in your configuration to record where you've
historically moved or renamed an object, Terraform treats an existing object at historically moved or renamed an object, Terraform treats an existing object at
the old address as if it now belongs to the new address. the old address as if it now belongs to the new address.
> **Hands On:** Try the [Use Configuration to Move Resources](https://learn.hashicorp.com/tutorials/terraform/move-config) tutorial on HashiCorp Learn.
## `moved` Block Syntax ## `moved` Block Syntax
A `moved` block expects no labels and contains only `from` and `to` arguments: A `moved` block expects no labels and contains only `from` and `to` arguments: