GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation allows users to post Terraform state data to a specific project in GitLab using the GitLab API. It is useful for automating the management of Terraform state files within GitLab projects, enabling infrastructure as code workflows to be integrated into n8n automation. For example, users can update or upload Terraform state files programmatically as part of a CI/CD pipeline.

Use Case Examples

  1. Uploading a Terraform state file to a GitLab project to keep infrastructure state synchronized.
  2. Automating Terraform state updates after infrastructure changes in a GitLab-managed environment.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters to specify the project ID and Terraform state name in the API path.

Output

JSON

  • response - The JSON response from the GitLab API after posting the Terraform state.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and Terraform state name are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to post Terraform state data to the project.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct.
  • Common errors include authentication failures (check API key), 404 not found (check project ID and state name), and validation errors from the API (check request body and parameters).

Links

Discussion