GitLab API

GitlabTool

Actions1000

Overview

This node interacts with the GitLab API to retrieve a specific Terraform state associated with a project. It is useful for DevOps and infrastructure teams who manage Terraform states within GitLab projects, allowing them to programmatically access state details for automation or monitoring purposes.

Use Case Examples

  1. Retrieve the Terraform state named 'production' for a project with ID '12345' to verify infrastructure status.
  2. Fetch a Terraform state by name to integrate with a CI/CD pipeline that manages infrastructure deployments.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Query Parameters Optional query parameters for the API request, including Terraform state lock ID.
Path Parameters Path parameters specifying the project ID and Terraform state name to identify the resource.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • name - The name of the Terraform state.
  • terraformStateLockId - Optional Terraform state lock ID from query parameters.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly URL-encoded to avoid 404 errors.
  • Verify that the GitLab API key has sufficient permissions to access the project's Terraform state.
  • If skipping authentication, confirm that the GitLab instance allows unauthenticated access to the Terraform state endpoint.

Links

Discussion