Skip to content

Commit 507c75b

Browse files
ZachGoldbergcoderabbitai[bot]oredavids
authored
Pipelines GitLab Support Docs (#2393)
* bunch of stuff cursor made up * bump to docusuaurs 3.7, add some basic cursor rules * WIP - Security controls breakout of github vs gitlab * WIP - install docs * update overview * Update .cursor/rules/gitlab-background.mdc Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * link in the scm comparison * more gitlab support * missing file * remaining audit log updates * components update * start the ci workflow file * ci workflows * index page * remaining concept pages * specify a version for gitlab too * more gitlab in installation * add gitlab branch protectino * spurious recommendations * missing img * gitlab docs for extending pipelines * managing secrets and dd * plan/apply * env vars and eleegated repos * updating pipelines * tutorial 1 * tutorial 2 * Update docs/2.0/docs/pipelines/architecture/ci-workflows.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * Update docs/2.0/docs/pipelines/architecture/actions.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * Update docs/2.0/docs/pipelines/architecture/actions.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * Update docs/2.0/docs/pipelines/architecture/audit-logs.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * Update docs/2.0/docs/pipelines/installation/overview.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * Update docs/2.0/docs/pipelines/installation/viagithubapp.md Co-authored-by: Oreoluwa Agunbiade <[email protected]> * bit more consistency * more consistency * dict * fix link --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Oreoluwa Agunbiade <[email protected]>
1 parent 4a35881 commit 507c75b

33 files changed

+1930
-586
lines changed

Diff for: .cursor/rules/gitlab-background.mdc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: Background on how github vs gitlab work
3+
globs:
4+
---
5+
6+
Pipelines supports both GitHub and GitLab.
7+
8+
GitLab does not yet support account factory.
9+
GitLab does not yet support the same level of customization as GitHub
10+
GitLab requires one machine user with just one token and does not have a gitlab app.
11+
## GitLab Setup Requirements
12+
13+
1. **Gruntwork Management Portal**: An active account is required
14+
2. **GitLab Group Access**:
15+
- Customers must provide Gruntwork with their GitLab group information
16+
- Gruntwork will authorize access for the specified groups
17+
18+
> Important: Please contact Gruntwork support to initiate the GitLab group authorization process.
19+
20+
<IMPORTANT>
21+
Whenever presenting information that diverges between github and gitlab, use the <Tabs> and <TabItem> components to distinguish the two sets of information UNLESS the distinction is just changing one word. For example, GitHub has pull requests and GitLab has merge requests, so we can just say ".... pull/merge requests..." and not need full <Tabs>.
22+
</IMPORTANT>

Diff for: .cursor/rules/tone.mdc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Setting the tone of documentation content
3+
globs:
4+
---
5+
Our voice for documentation content is:
6+
7+
**Relatable / Down-to-Earth / Knowledgeable, but Not Arrogant**
8+
* Write as if you’re talking to a peer, not a corporate overlord—approachable, clear, and free from jargon.
9+
* Use a friendly, no-nonsense tone that feels natural and easy to understand.
10+
* Explain complex concepts in a way that educates and empowers, not overwhelms.
11+
12+
**Writing Style Guidelines**
13+
* Use plain, clear language. If a reader needs to Google a word, we’re doing it wrong.
14+
* Write like a human, not a machine. No stiff, robotic corporate-speak—this should feel like a trusted friend explaining DevOps.
15+
* Avoid buzzwords and clichés. We don’t "synergize mission-critical paradigms"—we simplify DevOps so teams can move faster.
16+
* Use humor sparingly, but effectively. DevOps is hard—sometimes, a well-placed joke can make it feel a little easier.

Diff for: custom-dictionary.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ MTTR
4949
terrapatch
5050
Terrapatch
5151
KodeKloud
52-
GOVCLOUD
52+
preconfigured
53+
projectprefix
54+
GOVCLOUD

Diff for: docs/2.0/docs/pipelines/architecture/actions.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pipelines Actions
22

3-
When a user opens a pull request, Pipelines runs a set of operations as a Github Action Workflow in response to the proposed [infrastructure changes](/2.0/docs/pipelines/concepts/overview/#infrastructure-change). We call these operations _pipelines actions_. Gruntwork Pipelines supports the following pipelines actions:
3+
When a user opens a pull request, Pipelines runs a set of operations as a CI Workflow in response to the proposed [infrastructure changes](/2.0/docs/pipelines/concepts/overview/#infrastructure-change). We call these operations _pipelines actions_. Gruntwork Pipelines supports the following pipelines actions:
44

55
## Terragrunt plan
66

@@ -12,7 +12,10 @@ When a pull request is merged, Pipelines will automatically execute either `terr
1212

1313
## Skipping runs
1414

15-
Sometimes you find it necessary to make a change without going through the full pipelines process. This can be accomplished using GitHub's built in method for skipping workflow runs [by adding [skip ci] to your commit message](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/skipping-workflow-runs).
15+
Sometimes you find it necessary to make a change without going through the full pipelines process. This can be accomplished using built-in CI skip mechanisms:
16+
17+
- **GitHub**: Add `[skip ci]` to your commit or pull request message as described in the [GitHub documentation](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/skipping-workflow-runs)
18+
- **GitLab**: Add `[skip ci]` to your commit or merge request message as described in the [GitLab documentation](https://docs.gitlab.com/ee/ci/pipelines/index.html#skip-a-pipeline)
1619

1720
## Other actions
1821

Diff for: docs/2.0/docs/pipelines/architecture/audit-logs.md

+21-17
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Audit Logs
22

3-
Gruntwork Pipelines provides an audit log that records which GitHub user performed specific operations in your AWS accounts as a result of a [Pipelines Action](/2.0/docs/pipelines/architecture/actions.md).
3+
Gruntwork Pipelines provides an audit log that records which user performed specific operations in your AWS accounts as a result of a [Pipelines Action](/2.0/docs/pipelines/architecture/actions.md).
44

5-
Accessing AWS environments from a CI/CD system often involves assuming temporary credentials using [OpenID Connect (OIDC)](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services). Shared credentials can complicate tracking who performed specific actions in AWS accounts. Gruntwork Pipelines addresses this challenge by using [AWS CloudTrail](https://aws.amazon.com/cloudtrail/) with a naming convention that includes context from the triggering Pipelines Action in GitHub. This approach associates every API operation performed by Pipelines with a GitHub username and a specific pull request or branch, enabling your security team to efficiently investigate access-related issues and analyze individual user actions.
5+
Accessing AWS environments from a CI/CD system often involves assuming temporary credentials using OpenID Connect (OIDC). For platform-specific documentation, see:
6+
- [GitHub OIDC Configuration](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)
7+
- [GitLab OIDC Configuration](https://docs.gitlab.com/ee/ci/cloud_services/aws/)
8+
9+
Shared credentials can complicate tracking who performed specific actions in AWS accounts. Gruntwork Pipelines addresses this challenge by using [AWS CloudTrail](https://aws.amazon.com/cloudtrail/) with a naming convention that includes context from the triggering Pipelines Action. This approach associates every API operation performed by Pipelines with a username and a specific pull request or branch, enabling your security team to efficiently investigate access-related issues and analyze individual user actions.
610

711
## How it works
812

9-
Gruntwork Pipelines creates an audit log that tracks which user performed what action in which AWS account. It does this by setting the [AWS STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) session name to include the initiating GitHub username, the Pipelines name, and the pull request or branch that triggered the action. Logging is handled through [AWS CloudTrail](https://aws.amazon.com/cloudtrail/), where session names appear in the `User name` field, making it easy to identify which user performed an action. For information on locating logs, see [where you can find logs](#where-you-can-find-logs) and [querying data](#querying-data).
13+
Gruntwork Pipelines creates an audit log that tracks which user performed what action in which AWS account. It does this by setting the [AWS STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) session name to include the initiating username, the Pipelines name, and the merge request/pull request or branch that triggered the action. Logging is handled through [AWS CloudTrail](https://aws.amazon.com/cloudtrail/), where session names appear in the `User name` field, making it easy to identify which user performed an action. For information on locating logs, see [where you can find logs](#where-you-can-find-logs) and [querying data](#querying-data).
1014

1115
### What gets logged
1216

13-
Logs are generated for all operations performed by Gruntwork Pipelines across every AWS account. These logs leverage [AWS STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) session names to clearly label sessions with the GitHub username that requested the change and the associated pull request or branch.
17+
Logs are generated for all operations performed by Gruntwork Pipelines across every AWS account. These logs leverage [AWS STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) session names to clearly label sessions with the username that requested the change and the associated merge request/pull request or branch.
1418

15-
Each CloudTrail event linked to API calls from Pipelines [Actions](/2.0/docs/pipelines/architecture/actions.md) includes the session name in the `userIdentity` field. For example, if the GitHub user `SomeUserInYourOrg` initiated the 123rd pull request in your repository, the `userIdentity` field in a corresponding CloudTrail event would provide details such as the following.
19+
Each CloudTrail event linked to API calls from Pipelines [Actions](/2.0/docs/pipelines/architecture/actions.md) includes the session name in the `userIdentity` field. For example, if the user `SomeUserInYourOrg` initiated the 123rd request in your repository, the `userIdentity` field in a corresponding CloudTrail event would provide details such as the following.
1620

1721
```json
1822
{
1923
"eventVersion": "1.09",
2024
"userIdentity": {
2125
"type": "AssumedRole",
2226
"principalId": "xxxxxxxxxxxxxxxxxxxxx:SomeUserInYourOrg-via-GWPipelines@PR-123",
23-
"arn": "arn:aws:sts::123456789012:assumed-role/github/SomeUserInYourOrg-via-GWPipelines@PR-123",
27+
"arn": "arn:aws:sts::123456789012:assumed-role/<platform>/SomeUserInYourOrg-via-GWPipelines@PR-123",
2428
"accountId": "123456789012",
2529
"accessKeyId": "xxxxxxxxxxxx",
2630
"sessionContext": {
2731
"sessionIssuer": {
2832
"type": "Role",
2933
"principalId": "xxxxxxxxxxxxxxxxxxxxx",
30-
"arn": "arn:aws:iam::123456789012:role/github",
34+
"arn": "arn:aws:iam::123456789012:role/<role-name>",
3135
"accountId": "123456789012",
32-
"userName": "github"
36+
"userName": "<platform>"
3337
},
3438
"webIdFederationData": {
3539
"federatedProvider": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com",
@@ -45,23 +49,23 @@ Each CloudTrail event linked to API calls from Pipelines [Actions](/2.0/docs/pip
4549
}
4650
```
4751

48-
Due to the 64-character limit for STS session names, the originating repository is not included in the session name. To identify the originating repository, you can search through repositories for commits matching the user and branch/PR-number combination or contact the GitHub user directly.
52+
Due to the 64-character limit for STS session names, the originating repository is not included in the session name. To identify the originating repository, you can search through repositories for commits matching the user and request number combination or contact the user directly.
4953

5054
By combining this data with a [query service](#querying-data), you can analyze the usage patterns of Gruntwork Pipelines in your AWS accounts using CloudTrail logs.
5155

5256
### Who gets logged
5357

54-
Pipelines employs a naming scheme that integrates the GitHub user who triggered the Pipelines [Action](/2.0/docs/pipelines/architecture/actions.md) along with the pull request or branch that initiated the action. The AWS STS session name is formatted as follows:
55-
`<GitHubUserName>-via-GWPipelines@(PR-<PullRequestNumber>|<branch name>)`.
58+
Pipelines employs a naming scheme that integrates the user who triggered the Pipelines [Action](/2.0/docs/pipelines/architecture/actions.md) along with the request or branch that initiated the action. The AWS STS session name is formatted as follows:
59+
`<UserName>-via-GWPipelines@(PR-<RequestNumber>|<branch name>)`.
5660

57-
#### For pull request events
58-
When Pipelines runs in response to a pull request event (opened, updated, or reopened), the session name includes the user who made the most recent commit on the branch and the pull request number assigned by GitHub. For instance:
59-
- If the user `SomeUserInYourOrg` created pull request number `123`, the session name would be:
61+
#### For merge request/pull request events
62+
When Pipelines runs in response to a request event (opened, updated, or reopened), the session name includes the user who made the most recent commit on the branch and the request number. For instance:
63+
- If the user `SomeUserInYourOrg` created request number `123`, the session name would be:
6064
`SomeUserInYourOrg-via-GWPipelines@PR-123`.
6165

62-
#### For merged pull requests
63-
When Pipelines runs after a pull request is merged, the session name reflects the user who performed the merge (e.g., clicked the `merge` button) and the deploy branch name (e.g., `main`). For example:
64-
- If the user `SomeUserInYourOrg` merged a pull request to the branch `main`, the session name would be:
66+
#### For merged requests
67+
When Pipelines runs after a request is merged, the session name reflects the user who performed the merge and the deploy branch name (e.g., `main`). For example:
68+
- If the user `SomeUserInYourOrg` merged a request to the branch `main`, the session name would be:
6569
`SomeUserInYourOrg-via-GWPipelines@main`.
6670

6771
## Where you can find logs

Diff for: docs/2.0/docs/pipelines/architecture/github-workflows.md renamed to docs/2.0/docs/pipelines/architecture/ci-workflows.md

+32-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
# GitHub Workflows
1+
# CI Workflows
22

3-
Pipelines integrates with your repositories through GitHub Workflows, leveraging [Reusable Workflows](https://docs.github.com/en/actions/sharing-automations/reusing-workflows) from Gruntwork's [pipelines-workflows](https://github.com/gruntwork-io/pipelines-workflows) repository. The workflows in your repositories rely on Gruntwork workflows through the uses clause within a job. This is structured as follows:
3+
Pipelines integrates with your repositories through GitHub/GitLab Workflows, leveraging [GitHub Reusable Workflows](https://docs.github.com/en/actions/sharing-automations/reusing-workflows) and [GitLab Shared Components](https://docs.gitlab.com/ee/ci/components/) from Gruntwork's repositories. The workflows in your repositories rely on Gruntwork workflows through the uses/component clause within the workflow declaration. This is structured as follows:
4+
5+
import Tabs from '@theme/Tabs';
6+
import TabItem from '@theme/TabItem';
7+
8+
<Tabs>
9+
<TabItem value="GitHub" label="GitHub">
410

511
```yml
612
jobs:
713
GruntworkPipelines:
814
uses: gruntwork-io/pipelines-workflows/.github/workflows/pipelines-root.yml@v3
915
```
1016
17+
</TabItem>
18+
<TabItem value="GitLab" label="GitLab">
19+
20+
```yml
21+
include:
22+
- component: gitlab.com/gruntwork-io/pipelines-workflows/pipelines@3
23+
```
24+
</TabItem>
25+
</Tabs>
1126
## Workflow versioning
1227
1328
Gruntwork follows [Semantic Versioning](https://semver.org/) for `pipelines-workflows` releases. New releases are tracked using git tags in the `v.MAJOR.MINOR.PATCH` format. A major tag, such as `v.MAJOR`, is also maintained and updated to point to the latest release within that major version. For example, when releasing a patch update from `v3.0.1` to `v3.0.2`, the `v3` tag will be updated to reference the newer version.
1429

15-
When referencing a workflow, the version is specified in the `uses` clause. For example: `pipelines-root.yml@v3`. Using the major version, like v3, in your workflows ensures you receive the latest updates and performance enhancements.. However, you can choose to pin to a specific version if needed.
30+
When referencing a workflow, the version is specified in the `uses` or `component` clause. For example: `pipelines-root.yml@v3`. Using the major version, e.g. v3, in your workflows ensures you receive the latest updates and performance enhancements. However, you can choose to pin to a specific version if needed.
1631

1732
## Modifying workflows
1833

@@ -22,13 +37,17 @@ If you [fork the Gruntwork Workflows](https://docs.gruntwork.io/2.0/docs/pipelin
2237

2338
## Workflow dependencies
2439

40+
<Tabs>
41+
<TabItem value="GitHub" label="GitHub">
42+
2543
The `pipelines-workflows` repository includes the following reusable workflows:
2644

2745
- `pipelines-drift-detection.yml` - Used for [Pipelines Drift Detection](/2.0/docs/pipelines/concepts/drift-detection) in all repositories with Drift Detection installed.
2846
- `pipelines-root.yml` - The core Pipelines workflow for the `infrastructure-live-root` repository, providing core plan/apply functionality and account vending.
2947
- `pipelines-unlock.yml` - Used to manually unlock state files in all repositories.
3048
- `pipelines.yml` - The core Pipelines workflow for `infrastructure-live-access-control` and delegated repositories, supporting plan/apply operations.
3149

50+
3251
In your repositories, the following workflows are typically present:
3352

3453
#### infrastructure-live-root
@@ -49,3 +68,13 @@ In your repositories, the following workflows are typically present:
4968
- `pipelines-unlock.yml` - Uses the Gruntwork `pipelines-unlock.yml` workflow.
5069
- `pipelines.yml` - Uses `pipelines.yml`.
5170

71+
72+
</TabItem>
73+
<TabItem value="GitLab" label="GitLab">
74+
75+
Your `.gitlab-ci.yml` file will include the following workflow:
76+
77+
- `GruntworkPipelines` - The core Pipelines workflow for your repository.
78+
79+
</TabItem>
80+
</Tabs>

Diff for: docs/2.0/docs/pipelines/architecture/components.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The executor receives a pipeline action and an infrastructure change as input an
1212

1313
## Execution flow
1414

15-
Pipelines begins with an event in GitHub, such as the creation, update, or reopening of a pull request, or a push to `main` (e.g., merging a pull request). The orchestrator determines the set of infrastructure changes (`infra-change set`) and selects the appropriate action for each change. For every change in the set, the executor performs the necessary action and logs the results in GitHub, attaching them to the pull request that triggered the workflow.
15+
Pipelines begins with an event in GitHub/GitLab, such as the creation, update, or reopening of a merge request/pull request, or a push to `main` (e.g., merging a pull request). The orchestrator determines the set of infrastructure changes (`infra-change set`) and selects the appropriate action for each change. For every change in the set, the executor performs the necessary action and logs the results in GitHub/GitLab, attaching them to the merge request/pull request that triggered the workflow.
1616

1717
## Trust boundaries
1818

Diff for: docs/2.0/docs/pipelines/architecture/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Architecture
22

33
Gruntwork Pipelines is designed to provide flexibility, enabling you to utilize the components you need to manage your infrastructure in a way that aligns with your organization's requirements.
4-
4+
55

66
Understanding the components and their structure will help you use Pipelines and associated Infrastructure as Code (IaC) effectively.
77

@@ -15,8 +15,8 @@ All other infrastructure managed with Gruntwork software ultimately depends on r
1515

1616
### Workflows
1717

18-
- **Account Factory:** Provides an API for interacting with the Gruntwork Account Factory. It uses a [repository dispatch](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch) to create AWS account requests.
19-
18+
- **Account Factory:** (GitHub only) Provides an API for interacting with the Gruntwork Account Factory. It uses a [repository dispatch](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch) to create AWS account requests.
19+
2020
This workflow uses a [repository dispatch](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch) to create a standard AWS account creation request in the repository.
2121

2222
The workflow payload is a JSON object, which can be constructed using the sample HTML file included in the repository. This file can be customized for organizational needs, such as adding tagging fields or additional context.

0 commit comments

Comments
 (0)