-target warning seems innapropriate

concerning the following warning:

Warning: Applied changes may be incomplete

The plan was created with the -target option in effect, so some changes
requested in the configuration may have been ignored and the output values may
not be fully updated. Run the following command to verify that no other
changes are pending:
    terraform plan

Note that the -target option is not suitable for routine use, and is provided
only for exceptional situations such as recovering from errors or mistakes, or
when Terraform specifically suggests to use it as part of an error message.

If you are applying changes to a production environment and want to assure no changes other than the ones relevant to a certain module (say an ecs service you are interested in) occur, target is completely appropriate to use.

For us, modules may not be perfect; an example could be not ignoring changes made dynamically by AWS (desired count for asg’s).

Of course it would be preferable to terraform plan and have the entire environment reflected by your terraform files, but if you are using the -target flag, it is quite likely you are aware of what you are doing and the result of doing it.

Not to mention the time saved of targetting what you are interested in, shaving minutes off the alternative.

My two cents,
Cheers,
Doug

1 Like

I concur, and have opened an issue about it: