Skip to content

Commit 928ffba

Browse files
committed
docs: Refactoring shared content out into components
1 parent 10a54e9 commit 928ffba

File tree

5 files changed

+239
-266
lines changed

5 files changed

+239
-266
lines changed

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

Lines changed: 6 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import Tabs from '@theme/Tabs';
44
import TabItem from '@theme/TabItem';
55
import PersistentCheckbox from '/src/components/PersistentCheckbox';
66
import CustomizableValue from '/src/components/CustomizableValue';
7+
import InstallationPrerequisites from '/src/components/InstallationPrerequisites';
8+
import PlanningPipelinesSetup from '/src/components/PlanningPipelinesSetup';
9+
import BootstrappingCloudInfrastructure from '/src/components/BootstrappingCloudInfrastructure';
710

811
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.
912

@@ -32,67 +35,11 @@ This step only applies if you are using a self-hosted GitLab instance that is no
3235

3336
## Prerequisites
3437

35-
Before starting, ensure you have:
36-
37-
- **An active Gruntwork subscription** with Pipelines access. Verify by checking the [Gruntwork Developer Portal](https://app.gruntwork.io/account) and confirming access to "pipelines" repositories in your GitHub team.
38-
- **Cloud provider credentials** with permissions to create OIDC providers and IAM roles in accounts where Pipelines will manage infrastructure.
39-
- **Git installed** locally for cloning and managing your project.
40-
- **Existing IaC project** with Terragrunt configurations you want to manage with Pipelines (if you are using OpenTofu/Terraform, and want to start using Terragrunt, read the [Quickstart Guide](https://terragrunt.gruntwork.io/docs/getting-started/quick-start)).
38+
<InstallationPrerequisites scmPlatform="GitLab" />
4139

4240
## Planning Your Pipelines Setup
4341

44-
Before implementing Pipelines, it's crucial to plan your setup by identifying all the environments and cloud resources you need to manage.
45-
46-
### Identify Your Environments
47-
48-
Review your existing project structure and identify:
49-
50-
1. **All environments** you want to manage with Pipelines (e.g., `dev`, `staging`, `prod`)
51-
2. **Cloud accounts/subscriptions** associated with each environment
52-
3. **Directory paths** in your project that contain Terragrunt units for each environment
53-
4. **Existing OIDC resources** that may already be provisioned in your accounts
54-
55-
:::note Progress Checklist
56-
57-
<PersistentCheckbox id="inventory-environments" label="Create an inventory of all environments you want to manage with Pipelines." />
58-
<PersistentCheckbox id="map-cloud-accounts" label="Map each environment to its corresponding AWS Account / Azure Subscription." />
59-
<PersistentCheckbox id="identify-directory-paths" label="Identify the directory paths in your project for each environment's Terragrunt units." />
60-
<PersistentCheckbox id="check-existing-oidc" label="Check if OIDC providers and IAM roles already exist in your cloud accounts." />
61-
62-
:::
63-
64-
### Determine Required OIDC Roles
65-
66-
For each AWS Account / Azure Subscription you want to manage, you might already have some or all of the following resources provisioned.
67-
68-
<Tabs groupId="cloud-provider">
69-
<TabItem value="aws" label="AWS" default>
70-
71-
**Required AWS Resources:**
72-
73-
- An OIDC provider for GitLab
74-
- An IAM role for Pipelines to assume when running Terragrunt plan commands
75-
- An IAM role for Pipelines to assume when running Terragrunt apply commands
76-
77-
</TabItem>
78-
<TabItem value="azure" label="Azure">
79-
80-
**Required Azure Resources:**
81-
82-
- Entra ID Application for plans with Federated Identity Credential
83-
- Entra ID Application for applies with Federated Identity Credential
84-
- Service Principals with appropriate role assignments
85-
- Storage Account and Container for Terragrunt state storage (if not already existing)
86-
87-
</TabItem>
88-
</Tabs>
89-
90-
:::note Progress Checklist
91-
92-
<PersistentCheckbox id="list-required-oidc-roles" label="Create a list of all OIDC roles and resources needed for each AWS Account / Azure Subscription." />
93-
<PersistentCheckbox id="identify-existing-resources" label="Identify which resources already exist and which need to be created." />
94-
95-
:::
42+
<PlanningPipelinesSetup scmPlatform="GitLab" />
9643

9744
## Configuring SCM Access
9845

@@ -108,81 +55,7 @@ To create machine users for GitLab access, follow our [machine users guide](/2.0
10855

10956
## Bootstrapping Cloud Infrastructure
11057

111-
If your AWS accounts / Azure subscriptions don't already have all the required OIDC and state management resources, you'll need to bootstrap them. This section provides the infrastructure code needed to set up these resources.
112-
113-
:::tip
114-
115-
If you already have all the resources listed, you can skip this section.
116-
117-
If you have some of them provisioned, but not all, you can decide to either destroy the resources you already have provisioned and recreate them or import them into state. If you are not sure, please contact [Gruntwork support](/support).
118-
119-
:::
120-
121-
### Prepare Your Project
122-
123-
Clone your project to your local machine using [Git](https://docs.gitlab.com/user/project/repository/index.html#clone-a-repository) if you haven't already.
124-
125-
:::tip
126-
127-
If you don't have Git installed, you can install it by following the official guide for [Git installation](https://git-scm.com/downloads).
128-
129-
:::
130-
131-
For example:
132-
133-
```bash
134-
git clone [email protected]:acme/infrastructure-live.git
135-
cd infrastructure-live
136-
```
137-
138-
:::note Progress Checklist
139-
140-
<PersistentCheckbox id="clone-repository" label="Clone your project locally (if not already done)." />
141-
<PersistentCheckbox id="cd-into-repository" label="Navigate into your project." />
142-
143-
:::
144-
145-
To bootstrap your project, we'll use Boilerplate to scaffold it with the necessary IaC code to provision the infrastructure necessary for Pipelines to function.
146-
147-
The easiest way to install Boilerplate is to use `mise` to install it.
148-
149-
:::tip
150-
151-
If you don't have `mise` installed, you can install it by following the official guide for [mise installation](https://mise.jdx.dev/getting-started.html).
152-
153-
:::
154-
155-
```bash
156-
mise use -g boilerplate@latest
157-
```
158-
159-
:::tip
160-
161-
If you'd rather install a specific version of Boilerplate, you can use the `ls-remote` command to list the available versions.
162-
163-
```bash
164-
mise ls-remote boilerplate
165-
```
166-
167-
:::
168-
169-
:::note Progress Checklist
170-
171-
<PersistentCheckbox id="install-boilerplate" label="Install Boilerplate." />
172-
173-
:::
174-
175-
If you don't already have Terragrunt and OpenTofu installed locally, you can install them using `mise`:
176-
177-
```bash
178-
mise use -g terragrunt@latest opentofu@latest
179-
```
180-
181-
:::note Progress Checklist
182-
183-
<PersistentCheckbox id="install-terragrunt-and-opentofu" label="Install Terragrunt and OpenTofu locally (if not already installed)." />
184-
185-
:::
58+
<BootstrappingCloudInfrastructure scmPlatform="GitLab" />
18659

18760
### Cloud-specific bootstrap instructions
18861

docs/2.0/docs/pipelines/installation/addingexistingrepo.mdx

Lines changed: 6 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import Tabs from '@theme/Tabs';
44
import TabItem from '@theme/TabItem';
55
import PersistentCheckbox from '/src/components/PersistentCheckbox';
6+
import InstallationPrerequisites from '/src/components/InstallationPrerequisites';
7+
import PlanningPipelinesSetup from '/src/components/PlanningPipelinesSetup';
8+
import BootstrappingCloudInfrastructure from '/src/components/BootstrappingCloudInfrastructure';
69

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

@@ -17,67 +20,11 @@ To configure Gruntwork Pipelines in an existing repository, complete the followi
1720

1821
## Prerequisites
1922

20-
Before starting, ensure you have:
21-
22-
- **An active Gruntwork subscription** with Pipelines access. Verify by checking the [Gruntwork Developer Portal](https://app.gruntwork.io/account) and confirming access to "pipelines" repositories in your GitHub team.
23-
- **Cloud provider credentials** with permissions to create OIDC providers and IAM roles in accounts where Pipelines will manage infrastructure.
24-
- **Git installed** locally for cloning and managing your repository.
25-
- **Existing IaC repository** with Terragrunt configurations you want to manage with Pipelines (if you are using OpenTofu/Terraform, and want to start using Terragrunt, read the [Quickstart Guide](https://terragrunt.gruntwork.io/docs/getting-started/quick-start)).
23+
<InstallationPrerequisites scmPlatform="GitHub" />
2624

2725
## Planning Your Pipelines Setup
2826

29-
Before implementing Pipelines, it's crucial to plan your setup by identifying all the environments and cloud resources you need to manage.
30-
31-
### Identify Your Environments
32-
33-
Review your existing repository structure and identify:
34-
35-
1. **All environments** you want to manage with Pipelines (e.g., `dev`, `staging`, `prod`)
36-
2. **Cloud accounts/subscriptions** associated with each environment
37-
3. **Directory paths** in your repository that contain Terragrunt units for each environment
38-
4. **Existing OIDC resources** that may already be provisioned in your accounts
39-
40-
:::note Progress Checklist
41-
42-
<PersistentCheckbox id="inventory-environments" label="Create an inventory of all environments you want to manage with Pipelines." />
43-
<PersistentCheckbox id="map-cloud-accounts" label="Map each environment to its corresponding AWS Account / Azure Subscription." />
44-
<PersistentCheckbox id="identify-directory-paths" label="Identify the directory paths in your repository for each environment's Terragrunt units." />
45-
<PersistentCheckbox id="check-existing-oidc" label="Check if OIDC providers and IAM roles already exist in your cloud accounts." />
46-
47-
:::
48-
49-
### Determine Required OIDC Roles
50-
51-
For each AWS Account / Azure Subscription you want to manage, you might already have some or all of the following resources provisioned.
52-
53-
<Tabs groupId="cloud-provider">
54-
<TabItem value="aws" label="AWS" default>
55-
56-
**Required AWS Resources:**
57-
58-
- An OIDC provider for GitHub Actions
59-
- An IAM role for Pipelines to assume when running Terragrunt plan commands
60-
- An IAM role for Pipelines to assume when running Terragrunt apply commands
61-
62-
</TabItem>
63-
<TabItem value="azure" label="Azure">
64-
65-
**Required Azure Resources:**
66-
67-
- Entra ID Application for plans with Federated Identity Credential
68-
- Entra ID Application for applies with Federated Identity Credential
69-
- Service Principals with appropriate role assignments
70-
- Storage Account and Container for Terragrunt state storage (if not already existing)
71-
72-
</TabItem>
73-
</Tabs>
74-
75-
:::note Progress Checklist
76-
77-
<PersistentCheckbox id="list-required-oidc-roles" label="Create a list of all OIDC roles and resources needed for each AWS Account / Azure Subscription." />
78-
<PersistentCheckbox id="identify-existing-resources" label="Identify which resources already exist and which need to be created." />
79-
80-
:::
27+
<PlanningPipelinesSetup scmPlatform="GitHub" />
8128

8229
## Configuring SCM Access
8330

@@ -96,81 +43,7 @@ There are two ways to configure SCM access for Pipelines:
9643

9744
## Bootstrapping Cloud Infrastructure
9845

99-
If your AWS accounts / Azure subscriptions don't already have all the required OIDC and state management resources, you'll need to bootstrap them. This section provides the infrastructure code needed to set up these resources.
100-
101-
:::tip
102-
103-
If you already have all the resources listed, you can skip this section.
104-
105-
If you have some of them provisioned, but not all, you can decide to either destroy the resources you already have provisioned and recreate them or import them into state. If you are not sure, please contact [Gruntwork support](/support).
106-
107-
:::
108-
109-
### Prepare Your Repository
110-
111-
Clone your repository to your local machine using [Git](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) if you haven't already.
112-
113-
:::tip
114-
115-
If you don't have Git installed, you can install it by following the official guide for [Git installation](https://git-scm.com/downloads).
116-
117-
:::
118-
119-
For example:
120-
121-
```bash
122-
git clone [email protected]:acme/infrastructure-live.git
123-
cd infrastructure-live
124-
```
125-
126-
:::note Progress Checklist
127-
128-
<PersistentCheckbox id="clone-repository" label="Clone your repository locally (if not already done)." />
129-
<PersistentCheckbox id="cd-into-repository" label="Navigate into your repository." />
130-
131-
:::
132-
133-
To bootstrap your repository, we'll use Boilerplate to scaffold it with the necessary IaC code to provision the infrastructure necessary for Pipelines to function.
134-
135-
The easiest way to install Boilerplate is to use `mise` to install it.
136-
137-
:::tip
138-
139-
If you don't have `mise` installed, you can install it by following the official guide for [mise installation](https://mise.jdx.dev/getting-started.html).
140-
141-
:::
142-
143-
```bash
144-
mise use -g boilerplate@latest
145-
```
146-
147-
:::tip
148-
149-
If you'd rather install a specific version of Boilerplate, you can use the `ls-remote` command to list the available versions.
150-
151-
```bash
152-
mise ls-remote boilerplate
153-
```
154-
155-
:::
156-
157-
:::note Progress Checklist
158-
159-
<PersistentCheckbox id="install-boilerplate" label="Install Boilerplate." />
160-
161-
:::
162-
163-
If you don't already have Terragrunt and OpenTofu installed locally, you can install them using `mise`:
164-
165-
```bash
166-
mise use -g terragrunt@latest opentofu@latest
167-
```
168-
169-
:::note Progress Checklist
170-
171-
<PersistentCheckbox id="install-terragrunt-and-opentofu" label="Install Terragrunt and OpenTofu locally (if not already installed)." />
172-
173-
:::
46+
<BootstrappingCloudInfrastructure scmPlatform="GitHub" />
17447

17548
### Cloud-specific bootstrap instructions
17649

0 commit comments

Comments
 (0)