terraform state push --help
Jump to navigation
Jump to search
terraform state push --help
Usage: terraform [global options] state push [options] PATH
Update remote state from a local state file at PATH.
This command "pushes" a local state and overwrites remote state
with a local state file. The command will protect you against writing
an older serial or a different state file lineage unless you specify the
"-force" flag.
This command works with local state (it will overwrite the local
state), but is less useful for this use case.
If PATH is "-", then this command will read the state to push from stdin.
Data from stdin is not streamed to the backend: it is loaded completely
(until pipe close), verified, and then pushed.
Options:
-force Write the state even if lineages don't match or the
remote serial is higher.
-lock=false Don't hold a state lock during the operation. This is
dangerous if others might concurrently run commands
against the same workspace.
-lock-timeout=0s Duration to retry a state lock.
See also[edit]
- Terraform state:
terraform [ state | replace-provider | mv ],backend.tf, Remote state backends to manage Terraform state, State locking,terraform force-unlock, terraform.tfstate, .terraform/terraform.tfstate - Terraform state:
terraform state[list|mv|show|pull|push|rm|replace-provider],terraform state show module.alb.aws lb.this
Advertising: