github.com/iaas-resource-provision/iaas-rpc@v1.0.7-0.20211021023331-ed21f798c408/website/docs/cli/commands/untaint.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: untaint"
     4  sidebar_current: "docs-commands-untaint"
     5  description: |-
     6    The `terraform untaint` command tells Terraform that an object is functioning
     7    correctly, even though its creation failed or it was previously manually
     8    marked as degraded.
     9  ---
    10  
    11  # Command: untaint
    12  
    13  Terraform has a marker called "tainted" which it uses to track that an object
    14  might be damaged and so a future Terraform plan ought to replace it.
    15  
    16  Terraform automatically marks an object as "tainted" if an error occurs during
    17  a multi-step "create" action, because Terraform can't be sure that the object
    18  was left in a fully-functional state.
    19  
    20  You can also manually mark an object as "tainted" using the deprecated command
    21  [`terraform taint`](./taint.html), although we no longer recommend that
    22  workflow.
    23  
    24  If Terraform currently considers a particular object as tainted but you've
    25  determined that it's actually functioning correctly and need _not_ be replaced,
    26  you can use `terraform untaint` to remove the taint marker from that object.
    27  
    28  This command _will not_ modify any real remote objects, but will modify the
    29  state in order to remove the tainted status.
    30  
    31  If you remove the taint marker from an object but then later discover that it
    32  was degraded after all, you can create and apply a plan to replace it without
    33  first re-tainting the object, by using a command like the following:
    34  
    35  ```
    36  terraform apply -replace="aws_instance.example[0]"
    37  ```
    38  
    39  ## Usage
    40  
    41  Usage: `terraform untaint [options] address`
    42  
    43  The `address` argument is a [resource address](/docs/cli/state/resource-addressing.html)
    44  identifying a particular resource instance which is currently tainted.
    45  
    46  This command also accepts the following options:
    47  
    48  * `-allow-missing` - If specified, the command will succeed (exit code 0)
    49    even if the resource is missing. The command might still return an error
    50    for other situations, such as if there is a problem reading or writing
    51    the state.
    52  
    53  * `-lock=false` - Don't hold a state lock during the operation. This is
    54     dangerous if others might concurrently run commands against the same
    55     workspace.
    56  
    57  * `-lock-timeout=DURATION` - Unless locking is disabled with `-lock=false`,
    58    instructs Terraform to retry acquiring a lock for a period of time before
    59    returning an error. The duration syntax is a number followed by a time
    60    unit letter, such as "3s" for three seconds.
    61  
    62  * `-no-color` - Disables terminal formatting sequences in the output. Use this
    63    if you are running Terraform in a context where its output will be
    64    rendered by a system that cannot interpret terminal formatting.
    65  
    66  For configurations using
    67  [the `remote` backend](/docs/language/settings/backends/remote.html)
    68  only, `terraform untaint`
    69  also accepts the option
    70  [`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
    71  
    72  For configurations using
    73  [the `local` backend](/docs/language/settings/backends/local.html) only,
    74  `terraform untaint` also accepts the legacy options
    75  [`-state`, `-state-out`, and `-backup`](/docs/language/settings/backends/local.html#command-line-arguments).