• Martin Atkins's avatar
    core: Warn when creating and applying with -target · 7e29b9b5
    Martin Atkins authored
    The documentation for the -target option warns that it's intended for
    exceptional circumstances only and not for routine use, but that's not a
    very prominent location for that warning and so some users miss it.
    
    Here we make the warning more prominent by including it directly in the
    Terraform output when -target is in use. We first warn during planning
    that the plan might be incomplete, and then warn again after apply
    concludes and direct the user to run "terraform plan" to make sure that
    there are no further changes outstanding. The latter message is intended
    to reinforce that -target should only be a one-off operation and that you
    should always run without it soon after to ensure that the workspace is
    left in a consistent, converged state.
    7e29b9b5