GitLab API

GitlabTool

Actions905

Overview

This node operation deletes a specific Terraform state from a GitLab project using the GitLab API. It is useful for managing infrastructure as code by removing outdated or unnecessary Terraform state entries associated with a project. For example, it can be used in DevOps workflows to clean up Terraform states when a project is deleted or restructured.

Use Case Examples

  1. Deleting a Terraform state named 'production' from a project with ID '12345' to clean up infrastructure state data.
  2. Automating the removal of Terraform states in CI/CD pipelines when projects are archived or deleted.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method for the API request, default is GET but DELETE is used for this operation.
Path Parameters Parameters for the API path including project ID and Terraform state name to identify the resource to delete.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • body - Response body from the API after attempting to delete the Terraform state.

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 GitLab API key is missing or invalid; verify credentials are correctly configured.
  • Network or permission issues may prevent successful deletion; check network connectivity and user permissions on the GitLab project.

Links

Discussion