GitLab API

GitlabTool

Actions1000

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

Output

JSON

  • id - The ID of the Terraform state version.
  • name - The name of the Terraform state.
  • serial - The version number of the state.
  • created_at - Timestamp when the state version was created.
  • updated_at - Timestamp when the state version was last updated.
  • terraform_version - The version of Terraform used for this state.
  • state - The actual Terraform state data or metadata.

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 to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • 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 request parameters). Resolving these involves correcting credentials, parameters, or request formatting.

Discussion