GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation deletes a specific Terraform state associated with a GitLab project. It is useful for managing Terraform states within GitLab projects, especially when you need to remove outdated or unnecessary state files to maintain project hygiene or resolve state conflicts.

Use Case Examples

  1. Deleting a Terraform state named 'prod-state' from a project with ID '12345' to clean up old infrastructure states.
  2. Removing a Terraform state from a project before reinitializing the infrastructure setup.

Properties

Name Meaning
Skip Authentication Determines whether to skip the authentication process for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, defaulting to DELETE for this operation.
Path Parameters Parameters required in the API path to identify the project and the Terraform state name to delete.

Output

JSON

  • statusCode - The HTTP status code returned by the API after attempting to delete the Terraform state.
  • responseBody - The body of the response from the API, typically empty or containing confirmation of deletion.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified; incorrect values will result in a 404 Not Found error.
  • Authentication errors may occur if the API token is invalid or missing; verify the GitLab API credentials.
  • Network issues or incorrect base URL can cause connection failures; confirm the base URL is correct and accessible.

Links

Discussion