Merge pull request #26487 from hashicorp/jbardin/shell-escape

update taint command example
This commit is contained in:
James Bardin 2020-10-14 17:59:33 -04:00 committed by GitHub
commit ffbdd72196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -76,14 +76,18 @@ The resource aws_security_group.allow_all in the module root has been marked as
## 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\"]"
$ 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.
```
~> Note: In most `sh` compatible shells, double quotes and spaces can be
escaped by wrapping the argument in single quotes. This however varies between
other shells and operating systems, and users should use the appropriate escape
characters based on the applicable quoting rules for their shell to pass the
address string, including quotes, to Terraform.
## Example: Tainting a Resource within a Module