Command: state push

The terraform state push command is used to manually upload a local state file to remote state. This command also works with local state.

This command should rarely be used. It is meant only as a utility in case manual intervention is necessary with the remote state.

Usage

Usage: terraform state push [options] PATH

This command pushes the state specified by PATH to the currently configured backend.

If PATH is "-" then the state data to push is read from stdin. This data is loaded completely into memory and verified prior to being written to the destination state.

Terraform will perform a number of safety checks to prevent you from making changes that appear to be unsafe:

Both of these safety checks can be disabled with the -force flag. This is not recommended. If you disable the safety checks and are pushing state, the destination state will be overwritten.

For configurations using the HCP Terraform CLI integration or the remote backend only, terraform state push also accepts the option -ignore-remote-version.