GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation deletes a specific Terraform state by its name from a GitLab project. It is useful for managing Terraform states stored in GitLab, especially when you need to remove outdated or unnecessary state files from a project. For example, if you have multiple Terraform states for different environments or modules within a project, you can use this operation to delete a particular state by specifying the project ID and the state name.

Use Case Examples

  1. Deleting a Terraform state named 'prod' from a project with ID '12345' to clean up old infrastructure states.
  2. Removing a Terraform state file that is no longer needed after a project restructuring.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method used for the API request, hidden unless Skip Authentication is false. Defaults to GitLab API key.
baseUrl The base URL of the GitLab instance. Defaults to https://gitlab.com.
Method HTTP method for the API request. Defaults to DELETE for this operation.
Path Parameters Parameters for the API path, including the project ID and the Terraform state name to delete.

Output

JSON

  • success - Indicates whether the Terraform state was successfully deleted.
  • statusCode - HTTP status code returned by the API.
  • message - Additional message or details about the deletion result.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified; incorrect values will cause the API to fail.
  • Authentication errors may occur if the API key is missing or invalid; verify credentials are set up properly.
  • The node requires network access to the GitLab instance specified by the baseUrl; connectivity issues will cause failures.

Links

Discussion