Skip to content

Commit a0116b6

Browse files
committed
docs: Adding note for self-hosted GitLab instance
1 parent 8b82a84 commit a0116b6

File tree

2 files changed

+75
-11
lines changed

2 files changed

+75
-11
lines changed

docs/2.0/docs/pipelines/installation/addingexistinggitlabrepo.mdx

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,32 @@
33
import Tabs from '@theme/Tabs';
44
import TabItem from '@theme/TabItem';
55
import PersistentCheckbox from '/src/components/PersistentCheckbox';
6+
import CustomizableValue from '/src/components/CustomizableValue';
67

78
This guide provides comprehensive instructions for integrating [Gruntwork Pipelines](https://gruntwork.io/products/pipelines/) into an existing GitLab project with Infrastructure as Code (IaC). This is designed for Gruntwork customers who want to add Pipelines to their current infrastructure projects for streamlined CI/CD management.
89

910
To configure Gruntwork Pipelines in an existing GitLab project, complete the following steps (which are explained in detail below):
1011

11-
1. **Plan your Pipelines setup** by identifying all environments and cloud accounts/subscriptions you need to manage.
12-
2. **Bootstrap core infrastructure** in accounts/subscriptions that don't already have the required OIDC and state management resources.
13-
3. **Configure SCM access** using [machine users](/2.0/docs/pipelines/installation/viamachineusers) with appropriate Personal Access Tokens (PATs).
14-
4. **Create `.gruntwork` HCL configurations** to tell Pipelines how to authenticate and organize your environments.
15-
5. **Create `.gitlab-ci.yml`** to configure your GitLab CI/CD pipeline.
16-
6. **Commit and push** your changes to activate Pipelines.
12+
1. **(If using a self-hosted GitLab instance) Ensure OIDC configuration and JWKS are publicly accessible.**
13+
2. **Plan your Pipelines setup** by identifying all environments and cloud accounts/subscriptions you need to manage.
14+
3. **Bootstrap core infrastructure** in accounts/subscriptions that don't already have the required OIDC and state management resources.
15+
4. **Configure SCM access** using [machine users](/2.0/docs/pipelines/installation/viamachineusers) with appropriate Personal Access Tokens (PATs).
16+
5. **Create `.gruntwork` HCL configurations** to tell Pipelines how to authenticate and organize your environments.
17+
6. **Create `.gitlab-ci.yml`** to configure your GitLab CI/CD pipeline.
18+
7. **Commit and push** your changes to activate Pipelines.
19+
20+
## Ensure OIDC configuration and JWKS are publicly accessible
21+
22+
This step only applies if you are using a self-hosted GitLab instance that is not accessible from the public internet. If you are using GitLab.com or a self-hosted instance that is publicly accessible, you can skip this step.
23+
24+
1. [Follow GitLab's instructions](https://docs.gitlab.com/ci/cloud_services/aws/#configure-a-non-public-gitlab-instance) for hosting your OIDC configuration and JWKS in a public location (e.g. S3 Bucket). This is necessary for both Gruntwork and the AWS OIDC provider to access the GitLab OIDC configuration and JWKS when authenticating JWT's generated by your custom instance.
25+
2. Note the <CustomizableValue id="ISSUER_URL" /> (stored as `ci_id_tokens_issuer_url` in your `gitlab.rb` file per GitLab's instructions) generated above for reuse in the next steps.
26+
27+
:::note Progress Checklist
28+
29+
<PersistentCheckbox id="configure-oidc-jwks" label="(If using a self-hosted GitLab instance) Configure OIDC and JWKS to be publicly accessible." />
30+
31+
:::
1732

1833
## Prerequisites
1934

@@ -268,6 +283,23 @@ boilerplate \
268283
--non-interactive
269284
```
270285

286+
If you're using a self-hosted GitLab instance, you'll want to make sure the issuer is set correctly when calling Boilerplate.
287+
288+
```bash
289+
boilerplate \
290+
--template-url 'github.com/gruntwork-io/terragrunt-scale-catalog//templates/boilerplate/aws/gitlab/account?ref=v1.0.0' \
291+
--output-folder . \
292+
--var 'AccountName=dev' \
293+
--var 'GitLabGroupName=acme' \
294+
--var 'GitLabRepoName=infrastructure-live' \
295+
--var 'GitLabInstanceURL=https://gitlab.com' \
296+
--var 'AWSAccountID=123456789012' \
297+
--var 'AWSRegion=us-east-1' \
298+
--var 'StateBucketName=my-state-bucket' \
299+
--var 'Issuer=$$ISSUER_URL$$' \
300+
--non-interactive
301+
```
302+
271303
You can also choose to store these values in a YAML file and pass it to Boilerplate using the `--var-file` flag.
272304

273305
```yaml title="vars.yml"

docs/2.0/docs/pipelines/installation/addinggitlabrepo.mdx

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,29 @@
33
import Tabs from '@theme/Tabs';
44
import TabItem from '@theme/TabItem';
55
import PersistentCheckbox from '/src/components/PersistentCheckbox';
6+
import CustomizableValue from '/src/components/CustomizableValue';
67

78
To configure Gruntwork Pipelines in a new GitLab project, complete the following steps (which are explained in detail below):
89

9-
1. Create an `infrastructure-live` project.
10-
2. Configure machine user tokens for GitLab access, or ensure that the appropriate machine user tokens are set up as project or organization secrets.
11-
3. Create `.gruntwork` HCL configurations to tell Pipelines how to authenticate in your environments.
12-
4. Create `.gitlab-ci.yml` to tell your GitLab CI/CD pipeline how to run your pipelines.
13-
5. Commit and push your changes to your project.
10+
1. (If using a self-hosted GitLab instance) Ensure OIDC configuration and JWKS are publicly accessible.
11+
2. Create an `infrastructure-live` project.
12+
3. Configure machine user tokens for GitLab access, or ensure that the appropriate machine user tokens are set up as project or organization secrets.
13+
4. Create `.gruntwork` HCL configurations to tell Pipelines how to authenticate in your environments.
14+
5. Create `.gitlab-ci.yml` to tell your GitLab CI/CD pipeline how to run your pipelines.
15+
6. Commit and push your changes to your project.
16+
17+
## Ensure OIDC configuration and JWKS are publicly accessible
18+
19+
This step only applies if you are using a self-hosted GitLab instance that is not accessible from the public internet. If you are using GitLab.com or a self-hosted instance that is publicly accessible, you can skip this step.
20+
21+
1. [Follow GitLab's instructions](https://docs.gitlab.com/ci/cloud_services/aws/#configure-a-non-public-gitlab-instance) for hosting your OIDC configuration and JWKS in a public location (e.g. S3 Bucket). This is necessary for both Gruntwork and the AWS OIDC provider to access the GitLab OIDC configuration and JWKS when authenticating JWT's generated by your custom instance.
22+
2. Note the <CustomizableValue id="ISSUER_URL" /> (stored as `ci_id_tokens_issuer_url` in your `gitlab.rb` file per GitLab's instructions) generated above for reuse in the next steps.
23+
24+
:::note Progress Checklist
25+
26+
<PersistentCheckbox id="configure-oidc-jwks" label="(If using a self-hosted GitLab instance) Configure OIDC and JWKS to be publicly accessible." />
27+
28+
:::
1429

1530
## Creating the infrastructure-live project
1631

@@ -167,6 +182,23 @@ boilerplate \
167182
--non-interactive
168183
```
169184

185+
If you're using a self-hosted GitLab instance, you'll want to make sure the issuer is set correctly when calling Boilerplate.
186+
187+
```bash
188+
boilerplate \
189+
--template-url 'github.com/gruntwork-io/terragrunt-scale-catalog//templates/boilerplate/aws/gitlab/infrastructure-live?ref=v1.0.0' \
190+
--output-folder . \
191+
--var 'AccountName=dev' \
192+
--var 'GitLabGroupName=acme' \
193+
--var 'GitLabRepoName=infrastructure-live' \
194+
--var 'GitLabInstanceURL=https://gitlab.com' \
195+
--var 'AWSAccountID=123456789012' \
196+
--var 'AWSRegion=us-east-1' \
197+
--var 'StateBucketName=my-state-bucket' \
198+
--var 'Issuer=$$ISSUER_URL$$' \
199+
--non-interactive
200+
```
201+
170202
:::
171203

172204
:::note Progress Checklist

0 commit comments

Comments
 (0)