Skip to content

Commit 2dbc4f5

Browse files
Pipelines section 2 : Changes to Pipelines/Installation files (#2306)
* Update overview.md * Update awslandingzone.md * Update authoverview.md * Update viagithubapp.md * Update viamachineusers.md * Update addingnewrepo.md * Update addingexistingrepo.md * Update branch-protection.md * Update destroying-infrastructure.md * Update addingexistingrepo.md * Update docs/2.0/docs/pipelines/installation/addingexistingrepo.md * Update docs/2.0/docs/pipelines/installation/addingexistingrepo.md * Update docs/2.0/docs/pipelines/installation/addingexistingrepo.md * Update docs/2.0/docs/pipelines/installation/addingexistingrepo.md * Fix customizablevalue * Update docs/2.0/docs/pipelines/installation/addingexistingrepo.md * Update docs/2.0/docs/pipelines/installation/addingnewrepo.md * Update docs/2.0/docs/pipelines/installation/addingnewrepo.md * Update branch-protection.md * Update docs/2.0/docs/pipelines/installation/overview.md * Update docs/2.0/docs/pipelines/installation/overview.md * Update docs/2.0/docs/pipelines/installation/overview.md * Update docs/2.0/docs/pipelines/installation/viamachineusers.md * Update docs/2.0/docs/pipelines/installation/viamachineusers.md * Update docs/2.0/docs/pipelines/installation/viamachineusers.md * Update branch-protection.md * Update branch-protection.md * Update branch-protection.md * Update branch-protection.md * Update addingexistingrepo.md * Update viamachineusers.md * Update authoverview.md * Update awslandingzone.md * Update overview.md * Update authoverview.md * Update viagithubapp.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * Update viamachineusers.md * updates * more values * more landing zone changes * underscores * add existing repo updates * WIP - via machine users edits * updates --------- Co-authored-by: Zach Goldberg <[email protected]> Co-authored-by: Zach Goldberg <[email protected]>
1 parent fc6962a commit 2dbc4f5

File tree

9 files changed

+428
-477
lines changed

9 files changed

+428
-477
lines changed

docs/2.0/docs/pipelines/installation/addingexistingrepo.md

Lines changed: 54 additions & 56 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
# Initial setup
1+
# Initial Setup
22

3-
To set up Gruntwork Pipelines in a new repository you'll need to complete the following steps:
4-
1. Create your `infrastructure-live-root` repository from Gruntwork's GitHub template.
5-
2. Configure the Gruntwork.io GitHub App to authorize your `infrastructure-live-root` repository, alternatively ensure that the appropriate machine user tokens have been setup as repository or organization secrets.
6-
3. Update the Bootstrap Workflow to configure your AWS settings.
7-
4. Run the Bootstrap Workflow in your `infrastructure-live-root` repository to create pull requests and repositories.
3+
To configure Gruntwork Pipelines in a new repository, complete the following steps:
84

5+
1. Create your `infrastructure-live-root` repository using Gruntwork's GitHub template.
6+
2. Configure the Gruntwork.io GitHub App to authorize your `infrastructure-live-root` repository, or ensure that the appropriate machine user tokens are set up as repository or organization secrets.
7+
3. Update the Bootstrap Workflow to configure your AWS settings.
8+
4. Execute the Bootstrap Workflow in your `infrastructure-live-root` repository to generate pull requests and additional repositories.
99

10-
## Creating Infrastructure Live Root
10+
## Creating the infrastructure-live-root repository
1111

12-
To set up IaC Foundations, we use a pre-configured git repository template that includes best practices and also allows for customization.
12+
Gruntwork provides a pre-configured git repository template that incorporates best practices while allowing for customization.
1313

1414
[infrastructure-live-root-template](https://github.com/gruntwork-io/infrastructure-live-root-template)
1515

16-
This template creates an infrastructure-live-root repository with a bootstrap workflow that can be run to create scaffolding for a best practices Terragrunt configuration, including patterns for module defaults, global variables, and account baselines. It also configures Gruntwork Pipelines, which is easy to remove if you don't want it.
16+
This template generates an `infrastructure-live-root` repository with a bootstrap workflow designed to scaffold a best-practices Terragrunt configuration. It includes patterns for module defaults, global variables, and account baselines. Additionally, it integrates Gruntwork Pipelines, which can be removed if not required.
1717

18-
The workflow also optionally creates and scaffolds your `infrastructure-live-access-control` and `infrastructure-catalog` repositories.
18+
The workflow can optionally scaffold the `infrastructure-live-access-control` and `infrastructure-catalog` repositories.
1919

20-
Navigate to the template repository and select **Use this template** -> **Create a new Repository**. This will initiate repository creation. You should select your org as the owner, add a description if you like, make sure you are creating a **private** repo, and click **Create repository**.
20+
Navigate to the template repository and select **Use this template** -> **Create a new Repository**. Choose your organization as the owner, add a description if desired, set the repository to **private**, and click **Create repository**.
2121

22-
## Configuring Gruntwork App Settings
22+
## Configuring Gruntwork app settings
2323

24-
Configure the Gruntwork.io GitHub App to [add this repository as an Infra Root repository](/2.0/docs/pipelines/installation/viagithubapp#configuration).
24+
Use the Gruntwork.io GitHub App to [add the repository as an Infra Root repository](/2.0/docs/pipelines/installation/viagithubapp#configuration).
2525

26-
If you're using our [machine user model](/2.0/docs/pipelines/installation/viamachineusers.md) then ensure the `INFRA_ROOT_WRITE_TOKEN` (and `ORG_REPO_ADMIN_TOKEN` for enterprise customers) is added to this repository as a secret and/or is set as an organization secret.
26+
If using the [machine user model](/2.0/docs/pipelines/installation/viamachineusers.md), ensure the `INFRA_ROOT_WRITE_TOKEN` (and `ORG_REPO_ADMIN_TOKEN` for enterprise customers) is added to the repository as a secret or configured as an organization secret.
2727

28-
## Update The Bootstrap Workflow
28+
## Updating the Bootstrap Workflow
2929

30-
Return to your `infrastructure-live-root` repository and follow the instructions in the `README` to update the bootstrap workflow for your IaC Foundations. You will need to provide details of your AWS organization and accounts, as well as default values to be used when vending new accounts.
30+
Return to your `infrastructure-live-root` repository and follow the `README` instructions to update the bootstrap workflow for IaC Foundations. Provide details about your AWS organization, accounts, and default values for new account provisioning.
3131

32-
## Run The Workflow
32+
## Running the workflow
3333

34-
Follow the instructions in your `infrastructure-live-root` to run the Bootstrap workflow. Gruntwork is available to assist with questions around other patterns as they arise. When running the workflow you can select options to create `infrastructure-live-access-control` and `infrastructure-catalog` repositories. These will be created in your GitHub organization using values defined in the workflow file.
34+
Follow the instructions in your `infrastructure-live-root` repository to execute the Bootstrap Workflow. Gruntwork support is available to address any questions that arise. During the workflow execution, you can choose to create the `infrastructure-live-access-control` and `infrastructure-catalog` repositories. These repositories will be created in your GitHub organization using values defined in the workflow configuration.
3535

36-
### Infrastructure Live Access Control
36+
### Infrastructure live access control
3737

38-
This repository is only necessary for Enterprise customers, but is recommended for all customers. When running the Bootstrap workflow in your `infrastructure-live-root` account, select the option to "Bootstrap the infrastructure-access-control repository".
38+
This repository is primarily for Enterprise customers but is recommended for all users. When running the Bootstrap Workflow in your `infrastructure-live-root` repository, select the option to "Bootstrap the infrastructure-access-control repository."
3939

40-
### Infrastructure Modules
40+
### Infrastructure catalog
4141

42-
The Bootstrap workflow creates an empty infrastructure-catalog repository that will be used to store Terraform/OpenTofu modules that your organization has authored and intends to use within your organization. When running the Bootstrap workflow in your `infrastructure-live-root` account, select the option to "Bootstrap the infrastructure-catalog repository".
42+
The Bootstrap Workflow also creates an empty `infrastructure-catalog` repository. This repository is used to store Terraform/OpenTofu modules authored by your organization for internal use. During the Bootstrap Workflow execution in your `infrastructure-live-root` repository, select the option to "Bootstrap the infrastructure-catalog repository."
4343

44-
## Complete Instructions In The Bootstrap Pull Requests
44+
## Completing instructions in Bootstrap Pull Requests
4545

46-
Each of your repositories will now contain a Bootstrap Pull Request. Follow the instructions in the Pull Requests to complete setup of your IaC repositories.
46+
Each of your repositories will contain a Bootstrap Pull Request. Follow the instructions in these Pull Requests to finalize the setup of your IaC repositories.
4747

4848
:::info
4949

50-
These bootstrapping pull requests include some stock configuration, such as a `mise.toml` file which specifies versions of OpenTofu and Terragrunt to use. Please make sure you review these files and update the configuration to match your organization's requirements.
51-
:::
50+
The bootstrapping pull requests include pre-configured files, such as a `mise.toml` file that specifies versions of OpenTofu and Terragrunt. Ensure you review and update these configurations to align with your organization's requirements.
51+
:::
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Authenticating Gruntwork Pipelines
22

3-
Gruntwork Pipelines needs to authenticate with GitHub for various reasons, including:
4-
* Downloading Gruntwork code (e.g. the pipelines binary, Terraform modules, etc.) from the `gruntwork-io` GitHub organization.
5-
* Interacting with your repositories, e.g.:
6-
* Creating pull requests
7-
* Commenting on pull requests
8-
* (via Account Factory) Creating new repositories
9-
* (via Account Factory) Updating repository settings, e.g. enforcing branch protection
3+
Gruntwork Pipelines requires authentication with GitHub to perform various functions, including:
4+
* Downloading Gruntwork code, such as the Pipelines binary and Terraform modules, from the `gruntwork-io` GitHub organization.
5+
* Interacting with your repositories, such as:
6+
* Creating pull requests.
7+
* Commenting on pull requests.
8+
* Creating new repositories via Account Factory.
9+
* Updating repository settings, such as enforcing branch protection, via Account Factory.
1010

11-
Gruntwork provides two mechanisms to achieve this authentication: a [GitHub App](/2.0/docs/pipelines/installation/viagithubapp.md) and a strategy of using CI Users (aka [Machine Users](/2.0/docs/pipelines/installation/viamachineusers.md)) for generating/installing personal access tokens for pipelines to use.
11+
Gruntwork provides two authentication methods: a [GitHub App](/2.0/docs/pipelines/installation/viagithubapp.md) and CI Users ([Machine Users](/2.0/docs/pipelines/installation/viamachineusers.md)) with personal access tokens for Pipelines.
1212

13-
Broadly the two approaches achieve the same result and core pipelines functionality will work with either mechanism. There are, however, some features and benefits only available with authenticating using the GitHub app and as such it is our recommended approach. As we roll out new features to pipelines we endeavor to ensure they are available to both authentication mechanisms. However, we do anticipate that the list of features that are GitHub App exclusive will grow over time.
13+
Both approaches support the core functionality of Pipelines. However, the GitHub App provides additional features and benefits, making it the recommended method. While Gruntwork strives to ensure feature parity between the two authentication mechanisms, certain advanced features are exclusive to the GitHub App, and this list is expected to grow over time.
1414

15-
In summary:
15+
## Summary of authentication mechanisms
1616

17-
**Reasons to use the GitHub App**:
18-
* _Dramatically_ streamlined setup
19-
* Access to more features and functionality
20-
* Improved day to day user experience
21-
* Less maintenance overhead (no need to install, maintain and rotate powerful tokens)
17+
**Advantages of the GitHub App**:
18+
- Simplified setup process.
19+
- Access to enhanced features and functionality.
20+
- Improved user experience during regular operations.
21+
- Reduced maintenance, as there is no need to install, maintain, or rotate powerful tokens.
2222

23-
**Reasons to use Machine Users**
24-
* You need to work with GitHub on-prem Enterprise and your on-premise install doesn't allow interacting with third party servers (e.g. Gruntwork's backend)
25-
* You want a fallback solution to ensure that Pipelines can continue to function even if the Gruntwork-hosted backend that powers the GitHub App goes down
23+
**Advantages of Machine Users**:
24+
- Compatibility with on-premises GitHub Enterprise installations that cannot interact with third-party servers (e.g., Gruntwork's backend).
25+
- Provides a fallback solution to ensure Pipelines continue functioning in the unlikely event of an outage affecting the Gruntwork-hosted backend that powers the GitHub App.
Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
11
# Branch Protection
22

3-
Gruntwork Pipelines is designed to be used with a PR based workflow.
4-
This means an approval on a PR is an approval to deploy infrastructure, making the configuration of repository settings and branch protection especially important.
3+
Gruntwork Pipelines is designed to function within a PR-based workflow. Approving a pull request (PR) signals approval to deploy infrastructure, so it's important to configure repository settings and branch protection accurately.
54

6-
## Recommended Settings
5+
## Recommended settings
76

8-
By default, Gruntwork pipelines runs a plan on every push to a PR and an apply on every push to `main`.
9-
Branch protection should be enabled on `main` to prevent changes from being applied without approval.
7+
By default, Gruntwork Pipelines runs a `plan` on every push to a PR and an `apply` on every push to `main`. To ensure that infrastructure changes are reviewed and approved before deployment, branch protection should be enabled on `main` to prevent unauthorized changes.
8+
9+
- Enable **Require a pull request before merging** to ensure all changes go through a pull request.
10+
- Enable **Require approvals** to require at least one approval before merging. Optionally, configure more than one required approval.
11+
- Enable **Require review from code owners** for controlled reviews of specific code areas. For more details, see [GitHub Documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).
12+
- Enable **Require status checks to pass before merging** to ensure the `apply` does not run if the `plan` fails, or if organizational validation rules fail.
13+
- Enable **Require branches to be up to date before merging** and select the `Pipelines` workflow as required.
1014

11-
- **Require a pull request before merging** should be enabled.
12-
- **Require approvals** should be enabled. Optionally, more than one approval could be required.
13-
- **Require review from Code Owners** should be enabled if you need control over which users are required to review specific code areas. See the [GitHub Documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) for more information.
14-
- **Require status checks to pass before merging** should be enabled.
15-
:::info
16-
This prevents `apply` from running when `plan` fails and ensures any validation rules your organization has put in place have been run.
17-
:::
18-
- **Require branches to be up to date before merging** should be enabled with the `Pipelines` workflow selected as required.
1915
:::info
20-
This option prevents `apply` from running with an inaccurate `plan`, but has a tradeoff of increased GitHub Actions minute usage.
21-
When the PR is not up to date you will see the following message:
16+
17+
This prevents running an inaccurate `apply` by ensuring the PR is up-to-date. However, it increases GitHub Actions minute usage. If disabled, another PR merged into `main` after the `plan` could lead to an inaccurate `apply`. Evaluate whether this tradeoff aligns with your organization's risk tolerance.
18+
19+
Example warning when PR is not up-to-date:
20+
2221
![Recommended Branch Protection Settings](/img/pipelines/pr-sync.png)
23-
With this option disabled, another PR could be merged into `main` after this PR has run `plan`. No new plan would be run
24-
in that scenario, so the `apply` has a higher likelihood of failure. If this risk is acceptable to your organization you may
25-
choose to ignore this recommendation.
22+
2623
:::
2724

28-
The following is an example of the recommended settings for branch protection:
25+
Below is an example of the recommended branch protection settings:
26+
2927
![Recommended Branch Protection Settings](/img/pipelines/repo-settings.png)
3028

3129
:::info
32-
You may wish to enable **Do not allow bypassing the above settings** to prevent admins from bypassing the branch
33-
protection rules. This will limit your options for applying emergency fixes, but is more secure.
30+
Consider enabling **Do not allow bypassing the above settings** to prevent admins from bypassing branch protection rules. While this improves security, it may limit options for emergency fixes.
3431
:::
3532

3633
:::info
37-
As of writing, GitHub has also released new functionality that is broadly only available to GitHub Enterprise customers.
38-
This beta functionality allows for configuring [push rulesets](https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets#push-rulesets). To configure it, follow the documentation [here](https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/creating-rulesets-for-a-repository#creating-a-push-ruleset).
39-
Enabling this feature is recommended if it is available for you, as it allows you to prevent edits to `.github/workflows` files, ensuring that all infrastructure changes are reviewed, approved and propagated through Pipelines.
40-
41-
## PR Workflow
42-
43-
1. Developers make infrastructure changes on a branch and create a PR against `main`
44-
1. On PR creation, Gruntwork Pipelines runs `plan` on any changes and posts the results as a comment
45-
1. Gruntwork Pipelines re-runs `plan` on every push to the branch and posts results as a comment
46-
1. Approvals are gathered. If codeowners is enabled, the owner of each changed folder/file must approve the PR before it can be merged
47-
1. Once approved, the PR is merged into `main`
48-
1. Gruntwork Pipelines runs `apply` on any changes from the PR
49-
- On Success, the PR is updated to communicate the success of the apply
50-
- On Failure, the PR is updated to communicate the failure of the apply. If the apply cannot be fixed by retrying, a new PR must be created to resolve any failures.
34+
GitHub Enterprise customers can also configure [push rulesets](https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets#push-rulesets). This feature allows restricting edits to `.github/workflows` files, ensuring infrastructure changes are properly reviewed and approved through Pipelines. Follow the documentation [here](https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/creating-rulesets-for-a-repository#creating-a-push-ruleset) to enable push rulesets if available.
35+
:::
36+
37+
38+
## PR workflow
39+
40+
1. Developers make infrastructure changes on a branch and create a PR against `main`.
41+
2. On PR creation, Gruntwork Pipelines runs `plan` for any changes and posts the results as a comment.
42+
3. Gruntwork Pipelines re-runs `plan` on every push to the branch and updates the results in a comment.
43+
4. Gather approvals. If Code Owners is enabled, all relevant code owners must approve the PR.
44+
5. Once approved, merge the PR into `main`.
45+
6. Gruntwork Pipelines runs `apply` for the changes from the PR.
46+
- On success, the PR is updated to indicate the successful `apply`.
47+
- On failure, the PR is updated to indicate the failure of the `apply`. If the failure cannot be resolved by retrying, a new PR must be created to address the issues.

0 commit comments

Comments
 (0)