GitLab API icon

GitLab API

Gitlab

Actions1062

Terraform_state → postApiV4ProjectsIdTerraformStateNameLock

AI-generated

Summary

Locks a Terraform state in a GitLab project by sending a POST request to the /api/v4/projects/{id}/terraform/state/{name}/lock endpoint.

Inputs

  • id (required) — The ID or URL‑encoded path of the project (string).
  • name (required) — The Terraform state name (numeric ID, integer).
  • gitlabApi (required) — GitLab API credentials (unless skipAuthentication is set to true).
  • skipAuthentication — When true, bypasses credential authentication (boolean, default false).
  • baseUrl — Alternative GitLab instance URL (string, default https://gitlab.com).

Output shape

object

Returns the JSON response from GitLab containing the lock details (e.g., lock ID, owner, timestamp). On error, the node throws an exception with the response body.

Examples

Example 1: Lock Terraform state for project 123 and state name 456

Set Project ID to 123, State Name to 456, provide GitLab credentials, and execute the node.

Links

Discussion