GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation locks a Terraform state in a specific GitLab project using the GitLab API. It is useful for managing Terraform state files in infrastructure as code workflows, ensuring that the state is locked during updates to prevent concurrent modifications. For example, it can be used in CI/CD pipelines to lock the Terraform state before applying changes.

Use Case Examples

  1. Locking a Terraform state file in a GitLab project to prevent concurrent modifications during deployment.
  2. Automating Terraform state management in GitLab CI/CD pipelines.

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 to use for the API request, default is GET.
Path Parameters Parameters for the API request path, including project ID and Terraform state name.

Output

JSON

  • lock_id - Identifier of the lock created on the Terraform state.
  • locked_at - Timestamp when the Terraform state was locked.
  • locked_by - Information about the user who locked the Terraform state.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified to avoid 404 errors.
  • Authentication errors may occur if the GitLab API key is missing or invalid; verify credentials.
  • Check network connectivity and base URL correctness if requests fail to reach GitLab.

Links

Discussion