Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
21ede6d1
Commit
21ede6d1
authored
Dec 30, 2020
by
Emily Ring
Committed by
Russell Dickenson
Dec 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added documentation for new terraform list actions
parent
c0273365
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
4 deletions
+52
-4
doc/user/infrastructure/img/terraform_list_view_actions_v13_8.png
.../infrastructure/img/terraform_list_view_actions_v13_8.png
+0
-0
doc/user/infrastructure/img/terraform_list_view_v13_8.png
doc/user/infrastructure/img/terraform_list_view_v13_8.png
+0
-0
doc/user/infrastructure/terraform_state.md
doc/user/infrastructure/terraform_state.md
+52
-4
No files found.
doc/user/infrastructure/img/terraform_list_view_actions_v13_8.png
0 → 100644
View file @
21ede6d1
36.1 KB
doc/user/infrastructure/img/terraform_list_view_v13_8.png
0 → 100644
View file @
21ede6d1
73.1 KB
doc/user/infrastructure/terraform_state.md
View file @
21ede6d1
...
@@ -347,14 +347,62 @@ location. You can then go back to running it from within GitLab CI.
...
@@ -347,14 +347,62 @@ location. You can then go back to running it from within GitLab CI.
NOTE:
NOTE:
We are currently working on
[
providing a graphical interface for managing state files
](
https://gitlab.com/groups/gitlab-org/-/epics/4563
)
.
We are currently working on
[
providing a graphical interface for managing state files
](
https://gitlab.com/groups/gitlab-org/-/epics/4563
)
.
![
Terraform state list
](
img/terraform_list_view_v13_
5
.png
)
![
Terraform state list
](
img/terraform_list_view_v13_
8
.png
)
T
he state files attached to a project can be found under Operations / Terraform
.
T
o list the state files attached to a project go to
**Operations > Terraform**
.
## Removing a State file
![
Terraform state list
](
img/terraform_list_view_actions_v13_8.png
)
You can only remove a state file by making a request to the API, like the following example:
The list also includes an
**Actions**
column where you can download, lock or unlock, or remove each state file.
## Remove a state file
You can use the following options to remove a state file:
1.
GitLab REST API
1.
GitLab GraphQL API
1.
GitLab UI
### Remove a state file with the GitLab REST API
You can remove a state file by making a request to the REST API, for example:
```
shell
```
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>"
curl
--header
"Private-Token: <your_access_token>"
--request
DELETE
"https://gitlab.example.com/api/v4/projects/<your_project_id>/terraform/state/<your_state_name>"
```
```
### Remove a state file with the GitLab GraphQL API
You can remove a state file by making a GraphQL API request, for example:
```
shell
mutation deleteState
{
terraformStateDelete
(
input:
{
id
:
"<global_id_for_the_state>"
})
{
errors
}
}
```
You can obtain the
<global
_id_for_the_state
>
by querying the list of states. For example:
```
shell
query ProjectTerraformStates
{
project
(
fullPath:
"<your_project_path>"
)
{
terraformStates
{
nodes
{
id
name
}
}
}
}
```
For those new to the GitLab GraphQL API, see
[
Getting started with GitLab GraphQL API
](
../../api/graphql/getting_started.md
)
.
### Remove a state file with the GitLab UI
To delete a state file:
-
From your project, go to
**Operations > Terraform**
.
-
In the
**Actions**
column, click on the vertical ellipsis (
**{ellipsis_v}**
) button and select
**Remove state file and versions**
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment