Skip to content

GitLab Account factory docs #2677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

51 changes: 40 additions & 11 deletions docs/2.0/docs/accountfactory/guides/vend-aws-account.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,66 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Using the Account Factory Workflow

## Introduction
## Generate the account-request file

The Account Factory Workflow in your `infrastructure-live-root` repository can be used to create new AWS accounts. It requires a single input—a JSON payload—generated from the `account-factory-inputs.html` web page.
There are currently two ways to generate the account-request file:

The JSON payload approach provides greater flexibility for account vending, overcoming the GitHub workflow restriction of a 10-input maximum.
1. Using the [Gruntwork Developer Portal](/2.0/docs/accountfactory/guides/vend-aws-account?account-creation-method=ui#using-the-gruntwork-developer-portal) (**GitLab and GitHub non-enterprise customers**)
2. Using the [Account Factory workflow in your repository](/2.0/docs/accountfactory/guides/vend-aws-account?account-creation-method=workflow#using-the-account-factory-workflow-in-your-repository) (**GitHub only**)


<Tabs groupId="account-creation-method" queryString="account-creation-method">
<TabItem value="ui" label="Using Portal UI">

### Using the Gruntwork Developer Portal

1. Navigate to the [Account Request](https://app.gruntwork.io/account-factory/request-generator) page in the Gruntwork Developer Portal, as an authenticated user, to access the request generator UI.

:::note
![Account Request Generator](/img/accountfactory/dev-portal-request-generator.png)

This guide focuses on non-delegated repositories. Enterprise customers can also [use Account Factory to create new Delegated Repositories](/2.0/docs/accountfactory/guides/delegated-repositories).
1. If the form is disabled for filling out, request that an Admin in your Gruntwork Developer Account configures the Account factory settings.
1. Fill out the form with the required information and click on the "Generate Account Request" button.
1. Use the "Download" button to download the account-request file or the "Copy" button to copy the account-request file to your clipboard.
1. Navigate to your repository and create a new branch.
1. Create a new file in the `_new-account-requests` directory by moving the downloaded file to the directory or by creating a new file with the content of your clipboard. If copying content, ensure that the file is created with the correct name displayed in the generator output.
1. Commit your changes and open a Pull Request to the main branch.

</TabItem>
<TabItem value="workflow" label="Using Workflow in Repo">

### Using the Account Factory workflow in your repository

:::info
Only available for GitHub customers. This guide focuses on non-delegated repositories. Enterprise GitHub customers can also [use Account Factory to create new Delegated Repositories](/2.0/docs/accountfactory/guides/delegated-repositories).
:::

The Account Factory Workflow in your `infrastructure-live-root` repository can be used to create new AWS accounts. It requires a single input—a JSON payload—generated from the `account-factory-inputs.html` web page.

### Step 1 - Download the file
The JSON payload approach provides greater flexibility for account vending, overcoming the GitHub workflow restriction of a 10-input maximum.

#### Step 1 - Download the file

Locate the inputs web page in your `infrastructure-live-root` repository at `.github/workflows/account-factory-inputs.html` and download it to your local machine.

### Step 2 - Populate the values
#### Step 2 - Populate the values

Open the downloaded `account-factory-inputs.html` file in a web browser and populate the input fields as required.

Once all values are filled, click "Generate" and copy the resulting JSON output to your clipboard.

### Step 3 - Run the Account Factory workflow
#### Step 3 - Run the Account Factory workflow

Access the Actions tab in your `infrastructure-live-root` repository on GitHub and select `Account factory` from the left-hand pane.

Click "Run workflow" on the right, paste the generated JSON payload into the dropdown, and click the green "Run workflow" button to initiate the workflow.
After the workflow is complete, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR will add an account request to the `_new-account-requests` directory.

Comment on lines 55 to 59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

“Dropdown” is inaccurate for workflow_dispatch input; fix wording and verify workflow name casing. Also, specify the repo where the PR appears.

  • GitHub’s “Run workflow” UI uses an input field/textarea, not a dropdown, unless a “choice” type was defined.
  • Use the exact workflow name casing users will see.
  • Clarify where the PR is opened to reduce confusion.

Apply this diff:

-Access the Actions tab in your `infrastructure-live-root` repository on GitHub and select `Account factory` from the left-hand pane.
+Access the Actions tab in your `infrastructure-live-root` repository on GitHub and select `Account Factory` from the left-hand pane.  <!-- Adjust casing to match the actual workflow name -->
@@
-Click "Run workflow" on the right, paste the generated JSON payload into the dropdown, and click the green "Run workflow" button to initiate the workflow.
+Click "Run workflow" on the right, paste the generated JSON payload into the input field, and click the green "Run workflow" button to initiate the workflow.
-After the workflow is complete, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR will add an account request to the `_new-account-requests` directory.
+After the workflow completes, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR adds the account request under `_new-account-requests`.

Follow-up: Please confirm the exact workflow display name so we can match the casing precisely in the doc.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Access the Actions tab in your `infrastructure-live-root` repository on GitHub and select `Account factory` from the left-hand pane.
Click "Run workflow" on the right, paste the generated JSON payload into the dropdown, and click the green "Run workflow" button to initiate the workflow.
After the workflow is complete, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR will add an account request to the `_new-account-requests` directory.
Access the Actions tab in your `infrastructure-live-root` repository on GitHub and select `Account Factory` from the left-hand pane. <!-- Adjust casing to match the actual workflow name -->
Click "Run workflow" on the right, paste the generated JSON payload into the input field, and click the green "Run workflow" button to initiate the workflow.
After the workflow completes, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR adds the account request under `_new-account-requests`.
🤖 Prompt for AI Agents
In docs/2.0/docs/accountfactory/guides/vend-aws-account.md around lines 55 to
59, update the wording that currently says “paste the generated JSON payload
into the dropdown” to reflect GitHub’s workflow_dispatch UI (use “input field”
or “textarea” as appropriate) and replace the workflow name with the exact
display name/casing shown in GitHub; also clarify that the new Pull Request is
opened in the infrastructure-live-root repository (adding the
_new-account-requests path for clarity). Verify the exact workflow display name
in GitHub and use that exact casing in the docs before committing the change.

### Step 4 - Merge the account request PR
</TabItem>
</Tabs>

After the workflow is complete, a new Pull Request will be created in the `infrastructure-live-root` repository. This PR will add an account request to the `_new-account-requests` directory.
## Review and merge the account request PR

Review and merge the Pull Request to begin the account creation process.

Expand All @@ -43,7 +72,7 @@ Once the account request PR merges into the main branch, Pipelines will initiate

When the account is successfully created, Pipelines will open another Pull Request to baseline the account.

### Step 5 - Merge the Account Baseline PR
## Review and merge the Account Baseline PR

Review and merge the Account Baseline Pull Request. This PR contains essential infrastructure for enabling your delegated repository to plan and apply infrastructure changes in AWS. It also includes account baselines and configured account-specific infrastructure, such as a VPC.

Expand Down
10 changes: 8 additions & 2 deletions docs/2.0/docs/overview/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ Set up authentication for Pipelines to enable secure automation of infrastructur

<PersistentCheckbox id="install-df-3" label="Pipelines Auth Configured" />

### Step 4: [Create new Pipelines repositories](/2.0/docs/pipelines/installation/addingnewrepo)
### Step 4: Create new Pipelines repositories

Alternatively, you can [add Pipelines to an existing repository](/2.0/docs/pipelines/installation/addingexistingrepo).
- [New GitHub repository](/2.0/docs/pipelines/installation/addingnewrepo)
- [New GitLab repository](/2.0/docs/pipelines/installation/addingnewgitlabrepo)

Alternatively, you can add Pipelines to an existing repository:

- [Existing GitHub repository](/2.0/docs/pipelines/installation/addingexistingrepo)
- [Existing GitLab repository](/2.0/docs/pipelines/installation/addinggitlabrepo)

<PersistentCheckbox id="install-df-4" label="Pipelines Repositories Ready" />

Expand Down
4 changes: 2 additions & 2 deletions docs/2.0/docs/pipelines/installation/addinggitlabrepo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CustomizableValue from '/src/components/CustomizableValue';

# Adding Pipelines to a GitLab Project
# Adding Pipelines to an existing GitLab Project

This guide walks you through the process of adding Gruntwork Pipelines to a GitLab project. By the end, you'll have a fully configured GitLab CI/CD pipeline that can deploy infrastructure changes automatically.

Expand All @@ -11,7 +11,7 @@ Before you begin, make sure you have:
- Basic familiarity with Git, GitLab, and infrastructure as code concepts
- Access to one (or many) AWS account(s) where you have permission to create IAM roles and OIDC providers
- Completed the [Pipelines Auth setup for GitLab](/2.0/docs/pipelines/installation/viamachineusers#gitlab) and setup a machine user with appropriate PAT tokens
- Local access to Gruntwork's GitHub repositories, specifically [boilerplate](https://github.com/gruntwork-io/boilerplate) and the [architecture catalog](https://github.com/gruntwork-io/terraform-aws-architecture-catalog/)
- Local access to Gruntwork's GitHub repositories, specifically the [architecture catalog](https://github.com/gruntwork-io/terraform-aws-architecture-catalog/)

:::info

Expand Down
Loading