Skip to content

Commit

Permalink
accept HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
caetano-colin committed Jun 13, 2024
2 parents bf42108 + 7472009 commit a9d0e84
Show file tree
Hide file tree
Showing 138 changed files with 6,287 additions and 292 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
env:
DISABLE_TFLINT: 1
ENABLE_PARALLEL: 0
EXCLUDE_LINT_DIRS: \./5-app-infra/6-machine-learning|\./5-app-infra/projects/machine-learning
EXCLUDE_LINT_DIRS: \./5-app-infra/6-machine-learning|\./5-app-infra/projects/machine-learning|\./docs/assets/terraform

- run: docker run --rm -e DISABLE_TFLINT -e ENABLE_PARALLEL -e EXCLUDE_LINT_DIRS -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
env:
DISABLE_TFLINT: 1
ENABLE_PARALLEL: 0
EXCLUDE_LINT_DIRS: \./5-app-infra/6-machine-learning|\./5-app-infra/projects/machine-learning
EXCLUDE_LINT_DIRS: \./5-app-infra/6-machine-learning|\./5-app-infra/projects/machine-learning|\./docs/assets/terraform
68 changes: 34 additions & 34 deletions 0-bootstrap/README-GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ for each one of the repositories.

### Deploying step 0-bootstrap

1. Clone [terraform-example-foundation](https://github.com/terraform-google-modules/terraform-example-foundation) into your local environment.
1. Clone [terraform-google-enterprise-genai](https://github.com/terraform-google-modules/terraform-google-enterprise-genai) into your local environment.

```bash
git clone https://github.com/terraform-google-modules/terraform-example-foundation.git
git clone https://github.com/terraform-google-modules/terraform-google-enterprise-genai.git
```

1. Clone the private repository you created to host the `0-bootstrap` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the private repository you created to host the `0-bootstrap` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.
You must be [authenticated to GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github).

```bash
Expand All @@ -78,7 +78,7 @@ You must be [authenticated to GitHub](https://docs.github.com/en/authentication/

```bash
gcp-bootstrap/
terraform-example-foundation/
terraform-google-enterprise-genai/
```

1. Navigate into the repo. All subsequent
Expand Down Expand Up @@ -110,11 +110,11 @@ You must be [authenticated to GitHub](https://docs.github.com/en/authentication/
```bash
mkdir -p envs/shared
cp -RT ../terraform-example-foundation/0-bootstrap/ ./envs/shared
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/0-bootstrap/ ./envs/shared
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
cd ./envs/shared
```
Expand Down Expand Up @@ -153,7 +153,7 @@ export the GitHub fine grained access token as an environment variable:
1. Use the helper script [validate-requirements.sh](../scripts/validate-requirements.sh) to validate your environment:

```bash
../../../terraform-example-foundation/scripts/validate-requirements.sh -o <ORGANIZATION_ID> -b <BILLING_ACCOUNT_ID> -u <END_USER_EMAIL> -e
../../../terraform-google-enterprise-genai/scripts/validate-requirements.sh -o <ORGANIZATION_ID> -b <BILLING_ACCOUNT_ID> -u <END_USER_EMAIL> -e
```

**Note:** The script is not able to validate if the user is in a Cloud Identity or Google Workspace group with the required roles.
Expand Down Expand Up @@ -249,7 +249,7 @@ we recommend that you request 50 additional projects for the **projects step ser

## Deploying step 1-org

1. Clone the repository you created to host the `1-org` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the repository you created to host the `1-org` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.

```bash
git clone [email protected]:<GITHUB-OWNER>/<GITHUB-ORGANIZATION-REPO>.git gcp-org
Expand Down Expand Up @@ -281,11 +281,11 @@ we recommend that you request 50 additional projects for the **projects step ser
1. Copy contents of foundation to new repo.

```bash
cp -RT ../terraform-example-foundation/1-org/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/1-org/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```

Expand Down Expand Up @@ -365,7 +365,7 @@ See the shared folder [README.md](../1-org/envs/shared/README.md#inputs) for add

## Deploying step 2-environments

1. Clone the repository you created to host the `2-environments` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the repository you created to host the `2-environments` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.

```bash
git clone [email protected]:<GITHUB-OWNER>/<GITHUB-ENVIRONMENTS-REPO>.git gcp-environments
Expand Down Expand Up @@ -404,11 +404,11 @@ See the shared folder [README.md](../1-org/envs/shared/README.md#inputs) for add
1. Copy contents of foundation to new repo.

```bash
cp -RT ../terraform-example-foundation/2-environments/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/2-environments/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```

Expand Down Expand Up @@ -472,7 +472,7 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu

## Deploying step 3-networks-dual-svpc

1. Clone the repository you created to host the `3-networks-dual-svpc` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the repository you created to host the `3-networks-dual-svpc` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.

```bash
git clone [email protected]:<GITHUB-OWNER>/<GITHUB-NETWORKS-REPO>.git gcp-networks
Expand Down Expand Up @@ -510,11 +510,11 @@ or go to [Deploying step 3-networks-hub-and-spoke](#deploying-step-3-networks-hu
1. Copy contents of foundation to new repo.

```bash
cp -RT ../terraform-example-foundation/3-networks-dual-svpc/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/3-networks-dual-svpc/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```

Expand Down Expand Up @@ -635,7 +635,7 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
## Deploying step 3-networks-hub-and-spoke
1. Clone the repository you created to host the `3-networks-hub-and-spoke` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the repository you created to host the `3-networks-hub-and-spoke` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.
```bash
git clone [email protected]:<GITHUB-OWNER>/<GITHUB-NETWORKS-REPO>.git gcp-networks
Expand Down Expand Up @@ -673,11 +673,11 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/3-networks-hub-and-spoke/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/3-networks-hub-and-spoke/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down Expand Up @@ -786,7 +786,7 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
## Deploying step 4-projects
1. Clone the repository you created to host the `4-projects` terraform configuration at the same level of the `terraform-example-foundation` folder.
1. Clone the repository you created to host the `4-projects` terraform configuration at the same level of the `terraform-google-enterprise-genai` folder.
```bash
git clone [email protected]:<GITHUB-OWNER>/<GITHUB-PROJECTS-REPO>.git gcp-projects
Expand Down Expand Up @@ -825,11 +825,11 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/4-projects/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp -RT ../terraform-google-enterprise-genai/4-projects/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
mkdir -p .github/workflows
cp ../terraform-example-foundation/build/github-tf-* ./.github/workflows/
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp ../terraform-google-enterprise-genai/build/github-tf-* ./.github/workflows/
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down
48 changes: 24 additions & 24 deletions 0-bootstrap/README-Jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You arrived to these instructions because you are using the `jenkins_bootstrap`
- Access to the Jenkins Controller Web UI
- [SSH Agent Jenkins plugin](https://plugins.jenkins.io/ssh-agent) installed in your Jenkins Controller
- Private IP address for the Jenkins Agent: usually assigned by your network administrator. You will use this IP for the GCE instance that will be created in the `prj-b-cicd` GCP Project in step [II. Create the SEED and CI/CD projects using Terraform](#ii-create-the-seed-and-cicd-projects-using-terraform).
- Access to create five Git repositories, one for each directory in this [monorepo](https://github.com/terraform-google-modules/terraform-example-foundation) (`0-bootstrap, 1-org, 2-environments, 3-networks, 4-projects`). These are usually private repositories that might be on-prem.
- Access to create five Git repositories, one for each directory in this [monorepo](https://github.com/terraform-google-modules/terraform-google-enterprise-genai) (`0-bootstrap, 1-org, 2-environments, 3-networks, 4-projects`). These are usually private repositories that might be on-prem.

1. Generate a SSH key pair. In the Jenkins Controller host, use the `ssh-keygen` command to generate a SSH key pair.
- You will need this key pair to enable authentication between the Controller and Agent. Although the key pair can be generated in any linux machine, it is recommended not to copy the secret private key from one host to another, so you probably want to do this in the Jenkins Controller host command line.
Expand All @@ -78,7 +78,7 @@ You arrived to these instructions because you are using the `jenkins_bootstrap`
- Jenkins Agent’s private IP address (usually assigned by your Network Administrator. In the provided examples this IP is "172.16.1.6"). This private IP will be reachable through the VPN connection that you will create later.

1. Create five individual Git repositories in your Git server (This might be a task delegated to your infrastructure team)
- Note that although this infrastructure code is distributed to you as a [monorepo](https://github.com/terraform-google-modules/terraform-example-foundation), you will store the code in five different repositories, one for each directory:
- Note that although this infrastructure code is distributed to you as a [monorepo](https://github.com/terraform-google-modules/terraform-google-enterprise-genai), you will store the code in five different repositories, one for each directory:

```text
./0-bootstrap
Expand Down Expand Up @@ -113,7 +113,7 @@ You arrived to these instructions because you are using the `jenkins_bootstrap`
1. Clone this mono-repository with:
```bash
git clone https://github.com/terraform-google-modules/terraform-example-foundation
git clone https://github.com/terraform-google-modules/terraform-google-enterprise-genai
```
1. Clone the repository you created to host the `0-bootstrap` directory with:
Expand All @@ -132,7 +132,7 @@ You arrived to these instructions because you are using the `jenkins_bootstrap`
1. Copy contents of foundation to new repo (modify accordingly based on your current directory).
```bash
cp -RT ../terraform-example-foundation/0-bootstrap/ .
cp -RT ../terraform-google-enterprise-genai/0-bootstrap/ .
```
1. Activate the Jenkins module and disable the Cloud Build module. This implies manually editing the following files:
Expand Down Expand Up @@ -313,10 +313,10 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/1-org/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp ../terraform-example-foundation/build/Jenkinsfile .
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp -RT ../terraform-google-enterprise-genai/1-org/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
cp ../terraform-google-enterprise-genai/build/Jenkinsfile .
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down Expand Up @@ -419,10 +419,10 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/2-environments/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp ../terraform-example-foundation/build/Jenkinsfile .
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp -RT ../terraform-google-enterprise-genai/2-environments/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
cp ../terraform-google-enterprise-genai/build/Jenkinsfile .
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down Expand Up @@ -525,10 +525,10 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/3-networks-dual-svpc/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp ../terraform-example-foundation/build/Jenkinsfile .
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp -RT ../terraform-google-enterprise-genai/3-networks-dual-svpc/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
cp ../terraform-google-enterprise-genai/build/Jenkinsfile .
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down Expand Up @@ -678,10 +678,10 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/3-networks-hub-and-spoke/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp ../terraform-example-foundation/build/Jenkinsfile .
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp -RT ../terraform-google-enterprise-genai/3-networks-hub-and-spoke/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
cp ../terraform-google-enterprise-genai/build/Jenkinsfile .
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down Expand Up @@ -831,10 +831,10 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
1. Copy contents of foundation to new repo.
```bash
cp -RT ../terraform-example-foundation/4-projects/ .
cp -RT ../terraform-example-foundation/policy-library/ ./policy-library
cp ../terraform-example-foundation/build/Jenkinsfile .
cp ../terraform-example-foundation/build/tf-wrapper.sh .
cp -RT ../terraform-google-enterprise-genai/4-projects/ .
cp -RT ../terraform-google-enterprise-genai/policy-library/ ./policy-library
cp ../terraform-google-enterprise-genai/build/Jenkinsfile .
cp ../terraform-google-enterprise-genai/build/tf-wrapper.sh .
chmod 755 ./tf-wrapper.sh
```
Expand Down
Loading

0 comments on commit a9d0e84

Please sign in to comment.