GitLab API icon

GitLab API

Gitlab

Actions880

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 unnecessary state versions from a project's Terraform state storage in GitLab. For example, a DevOps engineer might use this operation to clean up old Terraform state versions to maintain a tidy and efficient infrastructure state management.

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 authentication.
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 relevant for this operation.
Path Parameters Parameters required in the request path to identify the Terraform state version to delete, including project ID, state name, and version serial number.

Output

JSON

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

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID, state name, and serial number are correctly provided and URL-encoded if necessary.
  • Verify that the API authentication token has sufficient permissions to delete Terraform state versions in the specified project.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages may include 404 Not Found if the specified Terraform state version does not exist, or 403 Forbidden if the authentication lacks necessary permissions.

Links

Discussion