GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves a specific version of a Terraform state from a GitLab project using the GitLab API. It is useful for users who need to access detailed information about a particular Terraform state version within a project, such as for auditing, state management, or infrastructure automation purposes. For example, a DevOps engineer might use this node to fetch the state version details to verify infrastructure changes or to troubleshoot deployment issues.

Use Case Examples

  1. Fetch Terraform state version details for project ID '123', state name 'prod-state', and version serial '5'.
  2. Retrieve a specific Terraform state version to integrate with an infrastructure monitoring workflow.

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, defaulting to https://gitlab.com.
Method HTTP method used for the API request, defaulting to GET.
Path Parameters Parameters to specify the project ID, Terraform state name, and version serial number for the request.

Output

JSON

  • id - The ID of the Terraform state version.
  • name - The name of the Terraform state.
  • serial - The version number of the Terraform state.
  • created_at - Timestamp when the state version was created.
  • updated_at - Timestamp when the state version was last updated.
  • state - The actual Terraform state data or metadata returned by the API.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID, state name, and serial number are correctly provided and URL-encoded if necessary.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access the Terraform state data.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (invalid or missing API key), 404 Not Found (incorrect project ID, state name, or serial), and 400 Bad Request (malformed parameters). Resolving these involves correcting credentials, parameters, or request formatting.

Links

Discussion