mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
website: docs for tainted command
This commit is contained in:
parent
b06a88d1ab
commit
fa9b655fd1
@ -80,6 +80,9 @@ func (c *TaintCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.Ui.Output(
|
||||||
|
"The resource %s in the module %s has been marked as tainted!",
|
||||||
|
name, strings.Join(mod.Path, "."))
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
51
website/source/docs/commands/taint.html.markdown
Normal file
51
website/source/docs/commands/taint.html.markdown
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
layout: "docs"
|
||||||
|
page_title: "Command: taint"
|
||||||
|
sidebar_current: "docs-commands-taint"
|
||||||
|
description: |-
|
||||||
|
The `terraform taint` command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Command: taint
|
||||||
|
|
||||||
|
The `terraform taint` command manually marks a Terraform-managed resource
|
||||||
|
as tainted, forcing it to be destroyed and recreated on the next apply.
|
||||||
|
|
||||||
|
This command _will not_ modify infrastructure, but does modify the
|
||||||
|
state file in order to mark a resource as tainted. Once a resource is
|
||||||
|
marked as tainted, the next
|
||||||
|
[plan](/docs/commands/plan.html) will show that the resource will
|
||||||
|
be destroyed and recreated and the next
|
||||||
|
[apply](/docs/commands/apply.html) will implement this change.
|
||||||
|
|
||||||
|
Forcing the recreation of a resource is useful when you want a certain
|
||||||
|
side effect of recreation that is not visible in the attributes of a resource.
|
||||||
|
For example: re-running provisioners will cause the node to be different
|
||||||
|
or rebooting the machine from a base image will cause new startup scripts
|
||||||
|
to run.
|
||||||
|
|
||||||
|
Note that tainting a resource for recreation may affect resources that
|
||||||
|
depend on the newly tainted resource. For example, a DNS resource that
|
||||||
|
uses the IP address of a server may need to be modified to reflect
|
||||||
|
the potentially new IP address of a tainted server. The
|
||||||
|
[plan command](/docs/commands/plan.html) will show this if this is
|
||||||
|
the case.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Usage: `terraform taint [options] name`
|
||||||
|
|
||||||
|
The `name` argument is the name of the resource to mark as tainted.
|
||||||
|
The format of this argument is `TYPE.NAME`, such as `aws_instance.foo`.
|
||||||
|
|
||||||
|
The command-line flags are all optional. The list of available flags are:
|
||||||
|
|
||||||
|
* `-backup=path` - Path to the backup file. Defaults to `-state-out` with
|
||||||
|
the ".backup" extension. Disabled by setting to "-".
|
||||||
|
|
||||||
|
* `-no-color` - Disables output with coloring
|
||||||
|
|
||||||
|
* `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate".
|
||||||
|
|
||||||
|
* `-state-out=path` - Path to write updated state file. By default, the
|
||||||
|
`-state` path will be used.
|
@ -98,6 +98,10 @@
|
|||||||
<li<%= sidebar_current("docs-commands-show") %>>
|
<li<%= sidebar_current("docs-commands-show") %>>
|
||||||
<a href="/docs/commands/show.html">show</a>
|
<a href="/docs/commands/show.html">show</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li<%= sidebar_current("docs-commands-taint") %>>
|
||||||
|
<a href="/docs/commands/taint.html">taint</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user