Difference between revisions of "Terraform plan -target"
Jump to navigation
Jump to search
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
− | terraform plan -target=module.db_aurora | + | [[terraform plan]] -target=module.db_aurora |
+ | [[terraform plan]] -target=module.db_aurora -target=aws_instance.your_instance_name | ||
+ | == Examples == | ||
+ | [[terraform plan]] -target [[google_sql_user]].your-db-users | ||
+ | |||
.../... | .../... | ||
Plan: 1 to add, 0 to change, 0 to destroy. | Plan: 1 to add, 0 to change, 0 to destroy. | ||
╷ | ╷ | ||
− | │ Warning: Resource targeting is in effect | + | │ [[Warning: Resource targeting is in effect]] |
│ | │ | ||
− | │ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested | + | │ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration. |
− | + | │ | |
− | |||
│ | │ | ||
− | │ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, | + | │ The -target option is not 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. |
− | + | │ | |
− | |||
╵ | ╵ | ||
+ | |||
+ | == Errors == | ||
+ | terraform plan -target yourwrongtarget | ||
+ | ╷ | ||
+ | │ Error: Invalid target "yourwrongtarget" | ||
+ | │ | ||
+ | │ Resource specification must include a resource type and name. | ||
+ | ╵ | ||
+ | |||
+ | For more help on using this command, run: | ||
+ | terraform plan -help | ||
== Related == | == Related == | ||
* <code>[[terraform apply -target]]=module.db_aurora</code> | * <code>[[terraform apply -target]]=module.db_aurora</code> | ||
+ | * <code>[[terraform show]]</code> | ||
+ | * No exclude option: https://github.com/hashicorp/terraform/issues/2253 | ||
== See also == | == See also == |
Latest revision as of 04:23, 21 March 2023
terraform plan -target=module.db_aurora terraform plan -target=module.db_aurora -target=aws_instance.your_instance_name
Contents
Examples[edit]
terraform plan -target google_sql_user.your-db-users .../... Plan: 1 to add, 0 to change, 0 to destroy. ╷ │ Warning: Resource targeting is in effect │ │ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration. │ │ │ The -target option is not 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. │ ╵
Errors[edit]
terraform plan -target yourwrongtarget ╷ │ Error: Invalid target "yourwrongtarget" │ │ Resource specification must include a resource type and name. ╵ For more help on using this command, run: terraform plan -help
Related[edit]
terraform apply -target=module.db_aurora
terraform show
- No exclude option: https://github.com/hashicorp/terraform/issues/2253
See also[edit]
Advertising: