Skip to content

Commit

Permalink
feat: add state import doc
Browse files Browse the repository at this point in the history
  • Loading branch information
eliecharra committed Jul 16, 2024
1 parent 45d81a9 commit 514832e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/vendors/terraform/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,40 @@ To do this, use the following steps:

## Importing existing state file into your Terraform Stacks

### On an existing stack

State import allows you to import a state on top of the latest managed state.

!!! warning

You should really understand what you are doing when importing a state.

To be able to import a state, the 3 conditions below must be satisfied:

- You must be a stack admin
- The stack must be locked
- The stack must not have any pending runs or tasks

To import a new state you need to go to the state history tab on your stack, and then click on the button to import the state.

![](../../assets/screenshots/terraform/state-management/import_state_action.png)

!!! info

The maximum allowed file size for a state is **100MB**.

Then choose a valid terraform state file and upload it.

![](../../assets/screenshots/terraform/state-management/import_state_modal.png)

Once the file is uploaded, you can click on **Import state**.

The imported state will appear in the list as manually imported.

![](../../assets/screenshots/terraform/state-management/import_state_list.png)

### During stack creation

When creating a stack, you can optionally import an existing Terraform state file so that Spacelift can manage it going
forward.

Expand Down

0 comments on commit 514832e

Please sign in to comment.