GitLab API

GitlabTool

Actions905

Overview

This node operation downloads a Terraform module from the GitLab Terraform Registry using the GitLab API. It is useful for automating the retrieval of specific Terraform modules by specifying the module's namespace, name, and system. For example, it can be used in CI/CD pipelines to fetch Terraform modules dynamically for infrastructure provisioning.

Use Case Examples

  1. Download a Terraform module by specifying the group ID or slug (module_namespace), module name, and module system to integrate with infrastructure as code workflows.
  2. Automate Terraform module retrieval in GitLab projects to ensure consistent module versions across environments.

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.
Path Parameters Parameters required in the request path to identify the Terraform module to download.

Output

JSON

  • data - The response data from the GitLab API containing the downloaded Terraform module content or metadata.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the module_namespace, module_name, and module_system path parameters are correctly set; incorrect values will cause the API request to fail.
  • If authentication is enabled, verify that the GitLab API key credential is valid and has sufficient permissions to access the Terraform module.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the URL is correct and accessible.
  • Common error messages include 404 Not Found if the module does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion