Come join Pulumi for the industry's first Cloud Engineering Summit! October 7–8. Save Your Spot

Pulumi GitLab Integration

With this new GitLab integration, Pulumi is able to add summary notes to a GitLab Merge Request by using the merge request information posted to the Pulumi Service via GitLab Webhooks.

To enable the integration with your GitLab project, you will need to ensure you have done the following two things:

  • Signup for a Pulumi account with your GitLab identity (or link your GitLab identity with an existing account.)
  • If your GitLab Project is under a GitLab Group, ensure that the group is added to Pulumi as an organization

Configuring the GitLab Webhook

  • Create a Pulumi access token using the account that you would like the merge request notes to be posted as. Save this token as we will use this momentarily in a following step.
    • The Pulumi account you use must have a GitLab identity associated with it, as well as have access to the GitLab Group for your project if your project is under a group.
  • You can configure a Group Hook or a Project Hook. The configuration values you use are the same regardless of where the webhook is registered on GitLab.
  • Configuring a webhook at the Group-level means that you don’t have to configure the webhook for every project manually. If you only want to configure a webhook for a certain project, then you may do that as well.
  • Head-over to the Settings > Webhooks page of your Group or Project and fill out the form as follows:
    • URL: https://api.pulumi.com/workflow/gitlab
    • Secret Token: <The Pulumi access token from above.>
    • Uncheck all boxes and check just the Merge request events checkbox

Group Hook Setup 1

  • Ensure the checkbox under SSL verification is checked as shown below
  • Click the Add webhook button.

Group Hook Setup 2

That’s it! Now when you create a merge request and run Pulumi in a merge request pipeline, you should see notes in the MR that show a summary of the Pulumi preview. Learn how to run Pulumi in GitLab CI/CD.

Here’s a preview of what it looks like.

Merge Request Note

Disabling the Integration

If would like to disable the integration for a specific execution of Pulumi, you can always set the PULUMI_DISABLE_CI_DETECTION env var to false without having to remove the integration configuration itself.