GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves a specific Terraform module file from the GitLab Terraform Registry using the GitLab API. It is useful for automating the fetching of Terraform module files based on module namespace, name, system, and version, which can be integrated into CI/CD pipelines or infrastructure automation workflows.

Use Case Examples

  1. Fetch a Terraform module file for a given namespace, module name, system, and version to use in automated infrastructure provisioning.
  2. Retrieve the latest version of a Terraform module file from GitLab to ensure infrastructure code is up to date.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication when making the API request.
Authentication Specifies the authentication method to use if authentication is not skipped.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request (GET, POST, PUT, DELETE, HEAD, PATCH).
Query Parameters Query parameters for the API request, specifically the module version to fetch.
Path Parameters Path parameters required to specify the module namespace, module name, and module system in the API request.

Output

JSON

  • fileContent - The content of the Terraform module file retrieved from the GitLab Terraform Registry.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure that the module_namespace, module_name, module_system, and module_version parameters are correctly specified and exist in the GitLab Terraform Registry.
  • If authentication is required and skipped, the request may fail with authorization errors; ensure proper authentication is configured unless skipping is intentional.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the module or version does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion