671aace8ec
Previously we forced all remote state backends to be wrapped in a BackupState wrapper that generates a local "terraform.tfstate.backup" file before updating the remote state. This backup mechanism was motivated by allowing users to recover a previous state if user error caused an undesirable change such as loss of the record of one or more resources. However, it also has the downside of flushing a possibly-sensitive state to local disk in a location where users may not realize its purpose and accidentally check it into version control. Those using remote state would generally prefer that state never be flushed to local disk at all. The use-case of recovering older states can be dealt with for remote backends by selecting a backend that has preservation of older versions as a first-class feature, such as S3 versioning or Terraform Enterprise's first-class historical state versioning mechanism. There remains still one case where state can be flushed to local disk: if a write to the remote backend fails during "terraform apply" then we will still create the "errored.tfstate" file to allow the user to recover. This seems like a reasonable compromise because this is done only in an _exceptional_ case, and the console output makes it very clear that this file has been created. Fixes #15339. |
||
---|---|---|
.. | ||
test-fixtures | ||
backend.go | ||
backend_apply.go | ||
backend_apply_test.go | ||
backend_local.go | ||
backend_plan.go | ||
backend_plan_test.go | ||
backend_refresh.go | ||
backend_refresh_test.go | ||
backend_test.go | ||
cli.go | ||
counthookaction_string.go | ||
hook_count.go | ||
hook_count_action.go | ||
hook_count_test.go | ||
hook_state.go | ||
hook_state_test.go | ||
local_test.go | ||
testing.go |