Commit 4fe98b99 authored by Tiger Watson's avatar Tiger Watson Committed by Marcia Ramos

Add docs section for managing individual Terraform state versions

parent e14c19ff
...@@ -384,6 +384,24 @@ Additional improvements to the ...@@ -384,6 +384,24 @@ Additional improvements to the
[graphical interface for managing state files](https://gitlab.com/groups/gitlab-org/-/epics/4563) [graphical interface for managing state files](https://gitlab.com/groups/gitlab-org/-/epics/4563)
are planned. are planned.
## Manage individual Terraform state versions
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/207347) in GitLab 13.4.
Individual state versions can be managed using the GitLab REST API.
Users with the [Developer role](../../permissions.md) can retrieve state versions using their serial number. To retrieve a version:
```shell
curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/projects/<your_project_id>/terraform/state/<your_state_name>/versions/<version-serial>"
```
Users with the [Maintainer role](../../permissions.md) can remove state versions using their serial number. To remove a version:
```shell
curl --header "Private-Token: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/<your_project_id>/terraform/state/<your_state_name>/versions/<version-serial>"
```
## Remove a state file ## Remove a state file
Users with Maintainer and greater [permissions](../../permissions.md) can use the Users with Maintainer and greater [permissions](../../permissions.md) can use the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment