You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found the --target=path to be incredibly useful but many times I would like to perform one operation that targets more than one resource and, often, order would be important. To solve this I'd have to write multiple terraform commands in a bash script and execute. What if I could do something like:
This request is especially important with the absence of module dependencies and it seems like this would be much easier to implement and could solve the problem of no module dependencies as well as give useful functionality that would improve terraform even if module dependency mapping were available. I am currently running a series of terraform targeted apply statements to get around not having module dependency mapping but I would still do this anyway. For instance, what if I want to delete everything but the VPC or stand up only part of my environment?
Bonus
It would be even nicer if you could have wildcard characters like #2182 requests and inverse targeting like #2253 requests. Negative applies could be started with !.
example:
target:
- !.module.bastion.*# first, apply everything but bastion module or what depends on it
- module.bastion.aws_iam_policy_document.* # then do all iam policies
- module.bastion.aws_iam_role.* # then do all iam roles- * # do a full terraform apply
The examples I provided are meant to show how the feature would work and not why it is needed. They were the best I could come up with. My actual code is much more complex and I didn't want to have to write a novel.
The Terraform team at HashiCorp is currently focused on configuration language improvements, but we intend to shift our focus to CLI enhancements once we complete the current set of work. At that time we'll review this again and see how it fits in with other possible improvements, including the ones you specifically mentioned here.
Feature Request: support target file with array
Consider
I have found the --target=path to be incredibly useful but many times I would like to perform one operation that targets more than one resource and, often, order would be important. To solve this I'd have to write multiple terraform commands in a bash script and execute. What if I could do something like:
where create_iam.yml file contents:
Extra Consideration
This request is especially important with the absence of module dependencies and it seems like this would be much easier to implement and could solve the problem of no module dependencies as well as give useful functionality that would improve terraform even if module dependency mapping were available. I am currently running a series of terraform targeted apply statements to get around not having module dependency mapping but I would still do this anyway. For instance, what if I want to delete everything but the VPC or stand up only part of my environment?
Bonus
It would be even nicer if you could have wildcard characters like #2182 requests and inverse targeting like #2253 requests. Negative applies could be started with !.
example:
The examples I provided are meant to show how the feature would work and not why it is needed. They were the best I could come up with. My actual code is much more complex and I didn't want to have to write a novel.
Related issues
allow
-target
to accept globs #2182feature request: inverse targeting / exclude #2253
The text was updated successfully, but these errors were encountered: