Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend/local: disable local backup of remote state #16464

Merged
merged 1 commit into from
Oct 28, 2017

Commits on Oct 26, 2017

  1. backend/local: disable local backup of remote state

    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.
    apparentlymart committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    244131c View commit details
    Browse the repository at this point in the history