GitLab API icon

GitLab API

Gitlab

Actions880

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 by specifying the module's namespace, name, system, and version. For example, it can be used in CI/CD pipelines to dynamically download Terraform modules for infrastructure provisioning.

Use Case Examples

  1. Fetch a Terraform module file for a given namespace, module name, system, and version to use in automated infrastructure deployment.
  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 Whether to skip authentication when making the API request.
Authentication The authentication method to use for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET.
Query Parameters.module_version The version of the Terraform module to retrieve.
Path Parameters.module_namespace The namespace (group ID or slug) of the Terraform module.
Path Parameters.module_name The name of the Terraform module.
Path Parameters.module_system The system type of the Terraform module.

Output

JSON

  • fileContent - The content of the requested Terraform module file.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the module_namespace, module_name, module_system, and module_version parameters are correctly set and correspond to an existing Terraform module in the GitLab registry.
  • Check that the GitLab API key credential is valid and has sufficient permissions to access the Terraform registry.
  • Verify the baseUrl is correct if using a self-hosted GitLab instance.
  • Common errors include 404 Not Found if the module or version does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion