From c6baf285082eab28a851234e6762cd0eddebde74 Mon Sep 17 00:00:00 2001 From: scott1138 <30352284+scott1138@users.noreply.github.com> Date: Thu, 24 Oct 2019 14:53:45 -0500 Subject: [PATCH] Update taint docs - for_each Provide an explanation of how to taint a resource created with for_each --- website/docs/commands/taint.html.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/website/docs/commands/taint.html.markdown b/website/docs/commands/taint.html.markdown index 8229f86461..3cca4289ef 100644 --- a/website/docs/commands/taint.html.markdown +++ b/website/docs/commands/taint.html.markdown @@ -73,6 +73,17 @@ $ terraform taint aws_security_group.allow_all The resource aws_security_group.allow_all in the module root has been marked as tainted. ``` +## Example: Tainting a single resource created with for_each + +It is necessary to wrap the resource in single quotes and escape the quotes. +This example will taint a single resource created with for_each: + +``` +$ terraform taint 'module.route_tables.azurerm_route_table.rt[\"DefaultSubnet\"]' +The resource module.route_tables.azurerm_route_table.rt["DefaultSubnet"] in the module root has been marked as tainted. +``` + + ## Example: Tainting a Resource within a Module This example will only taint a resource within a module: