Terraform & Helm: Terraform: state
6 Terraform & Helm commands: Terraform: state. Click a command to see what each part does.
Terraform & Helm: Terraform: stateIndex
Terraform: state6
terraform state list | grep <name>Find a resource in stateWhat each part does
state listevery resource address in the state| grep <name>keep matching addresses
terraform state show <address>Inspect one resourceWhat each part does
state show <address>all attributes stored for that resource
terraform state mv <old-address> <new-address>Rename/move without destroyingCautionWhat each part does
state mvchange the address in state (e.g. after refactoring into a module)
Tip Newer alternative: a moved {} block in code.
terraform state rm <address>Stop managing a resource (keep it in the cloud)CautionWhat each part does
state rmforget the resource; the real object is NOT deleted
terraform output -raw <name>Read an output for scriptsWhat each part does
output <name>print an output value-rawplain string without quotes (for shell variables)
terraform force-unlock <lock-id>Release a stuck lockDestructiveWhat each part does
force-unlock <lock-id>remove a lock left by a crashed run (ID is in the error message)
Tip Make sure nothing else is running against this state.
Nothing matches.
My DevOps Playbook by Angelo John Calleja