Skip to content

Commit f52cff3

Browse files
committed
Add reverting to a previous state to State Manipulation docs
1 parent a9f5618 commit f52cff3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

website/docs/cloud-docs/workspaces/state.mdx

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ You can view a workspace's state versions from its **States** tab. Each state in
2929

3030
Certain tasks (including importing resources, tainting resources, moving or renaming existing resources to match a changed configuration, and more) require modifying Terraform state outside the context of a run.
3131

32-
Manual state manipulation in Terraform Cloud workspaces requires the use of Terraform CLI, using the same commands as would be used in a local workflow (`terraform import`, `terraform taint`, etc.). To manipulate state, you must configure the [CLI integration](/cli/cloud) and authenticate with a user token that has permission to read and write state versions for the relevant workspace. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions))
32+
Manual state manipulation in Terraform Cloud workspaces, with the exception of [rolling back to a previous state version](#rolling-back-to-a-previous-state), requires the use of Terraform CLI, using the same commands as would be used in a local workflow (`terraform import`, `terraform taint`, etc.). To manipulate state, you must configure the [CLI integration](/cli/cloud) and authenticate with a user token that has permission to read and write state versions for the relevant workspace. ([More about permissions.](/cloud-docs/users-teams-organizations/permissions))
33+
34+
### Rolling Back to a Previous State
35+
36+
You can rollback to a previous, known good state version using the Terraform Cloud UI. Navigate to the state you want to rollback to and click the **Advanced** toggle button. This option requires that you have access to create new state and that you lock the workspace. It works by duplicating the state that you specify and making it the workspace's current state version. The workspace remains locked. To undo the rollback operation, rollback to the state version that was previously the latest state.
37+
38+
-> **Note:** You can rollback to any prior state, but you should use caution because replacing state improperly can result in orphaned or duplicated infrastructure resources. This feature is provided as a convenient alternative to manually downloading older state and using state manipulation commands in the CLI to push it to Terraform Cloud.
3339

3440
[permissions-citation]: #intentionally-unused---keep-for-maintainers
3541

@@ -68,7 +74,7 @@ By default, new workspaces in Terraform Cloud do not allow other workspaces to a
6874

6975
To configure a `tfe_outputs` data source that references a Terraform Cloud workspace, specify the organization and workspace in the `config` argument.
7076

71-
You must still properly configure the `tfe` provider with a valid authentication token and correct permissions to Terraform Cloud.
77+
You must still properly configure the `tfe` provider with a valid authentication token and correct permissions to Terraform Cloud.
7278

7379
```hcl
7480
data "tfe_outputs" "vpc" {
@@ -85,4 +91,4 @@ resource "aws_instance" "redis_server" {
8591
subnet_id = data.tfe_outputs.vpc.outputs.subnet_id
8692
}
8793
```
88-
-> **Note:** Remote state access controls do not apply when using the `tfe_outputs` data source.
94+
-> **Note:** Remote state access controls do not apply when using the `tfe_outputs` data source.

0 commit comments

Comments
 (0)