GitLab API

GitlabTool

Actions905

Overview

This node operation deletes a specific version of a Terraform state in a GitLab project. It is useful for managing Terraform state versions by removing outdated or unwanted state versions from a project's Terraform state history. For example, a DevOps engineer might use this node to clean up old Terraform state versions to maintain project hygiene and reduce clutter.

Use Case Examples

  1. Deleting a specific Terraform state version by providing the project ID, state name, and version serial number.
  2. Automating cleanup of Terraform state versions in CI/CD pipelines to ensure only relevant state versions are retained.

Properties

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

Output

JSON

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

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID, Terraform state name, and version serial are correctly provided and valid.
  • Authentication errors may occur if the GitLab API key is missing or invalid; verify credentials.
  • HTTP 404 errors indicate the specified Terraform state version or project was not found; check the parameters.
  • HTTP 403 errors indicate insufficient permissions to delete the Terraform state version; ensure the API key has appropriate access rights.

Links

Discussion