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

command: terraform state rm to require at least one argument #15479

Merged
merged 1 commit into from
Jul 5, 2017

Commits on Jul 5, 2017

  1. command: terraform state rm to require at least one argument

    Due to how the state filter machinery works, passing no arguments is valid
    and matches _all_ resources.
    
    It is very unlikely that someone wants to remove everything from state, so
    this ends up being a very dangerous default for the "terraform state rm"
    command, and surprising for someone who perhaps runs it looking for the
    usage information.
    
    So we'll be pragmatic here and reject the no-arguments case for this
    command, accepting that it makes the unlikely case of intentionally
    deleting all resources harder in order to make it less likely that it
    will happen _unintentionally_.
    
    If someone does really want to remove all resources from the state, they
    can provide an explicit empty string argument, but this isn't documented
    because it's a weird case that doesn't seem worth mentioning.
    
    This fixes #15283.
    apparentlymart committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    9373bac View commit details
    Browse the repository at this point in the history