Moving Items in Terraform State
Learn how to move items in a Terraform state.
We'll cover the following...
We'll cover the following...
The mv subcommand
The terraform state mv command is used to move items in a Terraform state.
Syntax
The mv subcommand has the following syntax: terraform state mv [options] SOURCE DESTINATION.
Arguments
Within the options, there are a few important flags to highlight.
-
The
dry-runflag can be thought of as a what-if. It tells us what it’ll do without making any changes. -
The
stateflag is the path of the source state file, which needs to be specified if we’re not using theterraform.tfstatefile or a remote back-end. -
The
state-outflag is the path of the destination file. Terraform uses the source state file unless this ...