A Pulumi package for creating and managing GitLab resources. The `pulumi-gitlab` library allows users to define, deploy, and manage GitLab entities such as projects, groups, users, and CI/CD configurations using Python code. It is currently at version 9.10.0 and maintains a frequent release cadence, often with weekly or bi-weekly updates.
pip install pulumi_gitlabVerified import paths — ran on the pinned version, not inferred.
This quickstart program demonstrates how to create a GitLab group and a project within that group using Pulumi and Python. It assumes the `GITLAB_TOKEN` environment variable is set for authentication.
Review `GroupMembership` resource definitions and `getProjectsProject` data source usages. Update code to reflect `memberRoleId` as optional and ensure `links` and `resourceGroupDefaultProcessMode` are provided when using `getProjectsProject`.
Ensure that `nodeId` is provided when using the `getRepositoryTreeTree` data source.
Set `baseUrl` in your Pulumi program or `GITLAB_BASE_URL` environment variable, e.g., `https://my.gitlab.server/api/v4/`.
For comprehensive access, use a dedicated Personal Access Token or a Service Account with the necessary scopes (e.g., `api`) for the provider's authentication.
Ensure `PULUMI_ACCESS_TOKEN` is set as a secret environment variable in your CI/CD pipeline and is configured to be accessible by the branches running Pulumi commands.
Verify your `GITLAB_TOKEN`. Ensure it's a Personal Access Token or Service Account token with appropriate scopes (e.g., `api`). Regenerate if necessary.
Ensure the stack is created with `pulumi stack init <stack-name>` before running `pulumi select` or `pulumi up`. Also, verify that the `PULUMI_ACCESS_TOKEN` has the necessary permissions to access the stack and organization.
Wait for the ongoing operation to complete. If no operation is actually running, manually clear the lock using `pulumi stack resume`.
Ensure you have `import pulumi_gitlab as gitlab` and are calling resources like `gitlab.Project(...)`. If you are importing directly, ensure it is `from pulumi_gitlab import Project` and then call `Project(...)`.