GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves the Terraform state information for a specific project in GitLab using the GitLab API. It is useful for DevOps and infrastructure teams who manage Terraform states within GitLab projects, allowing them to programmatically access state details for automation, auditing, or integration purposes. For example, it can be used to fetch the current Terraform state of a project to verify infrastructure status or to trigger further automation based on the state data.

Use Case Examples

  1. Fetch Terraform state details for project ID '123' and state name 'production'.
  2. Automate retrieval of Terraform state information to integrate with CI/CD pipelines.

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.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Query Parameters Optional query parameters for the request, including Terraform state lock ID.
Path Parameters Required path parameters including project ID and Terraform state name.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • name - The name of the Terraform state.
  • terraformStateData - The detailed Terraform state information returned by the API.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to access the project's Terraform state.
  • Check network connectivity and base URL configuration if the API request fails.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated access to the requested resource.

Links

Discussion