GitLab API

GitlabTool

Actions1000

Overview

This node operation deletes a Terraform state lock in a specified GitLab project. It is useful for managing Terraform state locks programmatically, especially when a lock needs to be manually removed to allow further Terraform operations. For example, if a Terraform state lock is stuck or orphaned, this node can be used to unlock it by specifying the project ID, the Terraform state name, and optionally the lock ID.

Use Case Examples

  1. Deleting a Terraform state lock in a GitLab project to resolve a stuck lock issue.
  2. Automating Terraform state management by unlocking states via GitLab API calls.

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 for the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but can be set to DELETE for this operation.
Query Parameters Optional query parameters for the request, specifically the Terraform state lock ID to delete.
Path Parameters Path parameters required for the request, including the project ID and the Terraform state name to identify the lock to delete.

Output

JSON

  • response - The response from the GitLab API after attempting to delete the Terraform state lock.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified; incorrect values will cause the API call to fail.
  • If authentication is skipped, the request may be unauthorized unless the GitLab instance allows anonymous access.
  • Verify that the lock ID query parameter is correct if used; an incorrect lock ID may result in failure to delete the lock.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (incorrect project ID or state name), and 403 Forbidden (insufficient permissions).

Links

Discussion