MichaelCarreon | 2022-06-13 22:59:59 UTC | #1
Hello All,
I want to know if there is a work around to use terraform apply or destroy to target not just one resource but all resource of the same type with having to type in multiple -target="resourcetype.name" ? For example I just want to destroy all resources "genesyscoudroutinglanguage"
Thank you, Michael Carreon
charlie.conneely | 2022-06-14 10:46:43 UTC | #2
Hi Michael,
I don't know of any one command that could perform this operation. However, you can achieve this programmatically by including the count attribute in each resource you want to destroy. For example, you could define a local variable as follows:
locals {
languagesCount = 0
}
, add the following line to each resource of type genesyscoud_routing_language
count = local.languagesCount
, and then re-run terraform apply.
This way, they won't be re-created on the next apply, and when you do want to create them, you just need to set languagesCount = 1
Hope this helps.
Regards, Charlie
system | 2022-07-15 10:46:09 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 15137