GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves the Terraform state information for a specific project and state name from the GitLab API. It is useful for users who want to programmatically access Terraform state data stored in GitLab, such as for infrastructure automation, auditing, or integration with other tools.

Use Case Examples

  1. Fetch the Terraform state of a project by providing the project ID and the Terraform state name to monitor infrastructure changes.
  2. Use the node to get the lock status of a Terraform state by optionally providing the Terraform state lock ID as a query parameter.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, defaulting to GET.
Query Parameters Optional query parameters for the API request, including the Terraform state lock ID (ID).
Path Parameters Path parameters required for the API request, including the project ID (id) and the Terraform state name (name).

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • name - The name of the Terraform state.
  • ID - Optional Terraform state lock ID provided as a query parameter.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly provided as path parameters to avoid 404 errors.
  • If authentication is enabled, verify that the GitLab API key credential is valid and has sufficient permissions to access the Terraform state.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.

Links

Discussion