Skip to content

Commit 57643a6

Browse files
feat: add FAQ, Glossary & Troubleshooting docs (#466)
* initial verison of docs folder and files * fix glossary link * update glossary and troubleshooting * add cross reference to troubleshooting * Add item for IPv6 issue in Cloud Shell * Apply suggestions from code review Co-authored-by: Bharath KKB <[email protected]> * make Troubleshooting a section under Prerequisites * adjust common errors heading * Add alternative to upgrade the terraform runner image version * upgrade option is only valid for versions 0.14.x Co-authored-by: Bharath KKB <[email protected]>
1 parent ee04cb5 commit 57643a6

File tree

9 files changed

+289
-39
lines changed

9 files changed

+289
-39
lines changed

0-bootstrap/README.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ file.
5555

5656
## Purpose
5757

58-
The purpose of this step is to bootstrap a Google Cloud organization, creating all the required resources & permissions to start using the Cloud Foundation Toolkit (CFT). This step also configures a CI/CD pipeline for foundations code in subsequent stages. The CI/CD pipeline can use either Cloud Build andCloud Source Repos or Jenkins and your own Git repos (which might live on-premises).
58+
The purpose of this step is to bootstrap a Google Cloud organization, creating all the required resources & permissions to start using the Cloud Foundation Toolkit (CFT). This step also configures a CI/CD pipeline for foundations code in subsequent stages. The CI/CD pipeline can use either Cloud Build and Cloud Source Repos or Jenkins and your own Git repos (which might live on-premises).
5959

6060
## Prerequisites
6161

@@ -66,7 +66,7 @@ installed:
6666
- [Terraform](https://www.terraform.io/downloads.html) version 0.13.6.
6767
- An existing project which the user has access to be used by terraform-validator.
6868

69-
Note: Make sure that you use the same version of Terraform throughout this
69+
**Note:** Make sure that you use the same version of Terraform throughout this
7070
series. Otherwise, you might experience Terraform state snapshot lock errors.
7171

7272
Also make sure that you've done the following:
@@ -93,6 +93,10 @@ For more information about the permissions that are required and the resources
9393
that are created, see the organization bootstrap module
9494
[documentation.](https://github.com/terraform-google-modules/terraform-google-bootstrap)
9595

96+
### Troubleshooting
97+
98+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
99+
96100
## Deploying with Jenkins
97101

98102
If you are using the `jenkins_bootstrap` sub-module, see
@@ -144,7 +148,7 @@ ERROR: logging before flag.Parse: I0413 13:49:49.852290 6380 convert.go:183] unk
144148

145149
These are warnings for resources that are not yet supported or not known by terraform-validator, these are not actual errors.
146150

147-
**Note 2:** After the deploy, even if you did not receive the project quota error described in the first item of the [Troubleshooting](#troubleshooting) section, we recommend that your request 50 additional projects for the service account, `terraform_service_account`, created in this step.
151+
**Note 2:** After the deploy, even if you did not receive the project quota error described in the [Troubleshooting guide](../docs/TROUBLESHOOTING.md#project-quota-exceeded), we recommend that you request 50 additional projects for the service account, `terraform_service_account`, created in this step.
148152

149153
## Running Terraform locally
150154

@@ -196,34 +200,3 @@ the following steps:
196200
| terraform\_validator\_policies\_repo | Cloud Source Repository created for terraform-validator policies. |
197201

198202
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
199-
200-
## Troubleshooting
201-
202-
When you run the examples in this repository, you might see the following errors
203-
during a Terraform `apply` command:
204-
205-
206-
- `Error code 8, message: The project cannot be created because you have exceeded
207-
your allotted project quota`.
208-
209-
- This message means you have reached your [project creation
210-
quota](https://support.google.com/cloud/answer/6330231). In this case, you can
211-
use the
212-
[Request Project Quota Increase](https://support.google.com/code/contact/project_quota_increase)
213-
form to request a quota increase. In the support form, for **Email addresses
214-
that will be used to create projects**, use the `terraform_sa_email` address
215-
that's created in the organization bootstrap module. If you see other quota
216-
errors, see the [Quota documentation](https://cloud.google.com/docs/quota).
217-
218-
- `Error: Error when reading or editing Organization Not Found : <organization-id>: googleapi: Error 403: The caller does not have permission, forbidden`.
219-
- Check that your user have [Organization Admin](https://cloud.google.com/iam/docs/understanding-roles#resource-manager-roles) predefined role at the Organization level.
220-
- If this is the case, try the following:
221-
```
222-
gcloud auth application-default login
223-
gcloud auth list # <- confirm that correct account has a star next to it
224-
```
225-
- Re-run `terraform` after.
226-
227-
- `Error: Error setting billing account "XXXXXX-XXXXXX-XXXXXX" for project "projects/some-project": googleapi: Error 400: Precondition check failed., failedPrecondition`. Most likely this is related to billing quota issue.
228-
- To confirm this, try `gcloud alpha billing projects link projects/some-project --billing-account XXXXXX-XXXXXX-XXXXXX`.
229-
- If output states `Cloud billing quota exceeded`, please request increase via [https://support.google.com/code/contact/billing_quota_increase](https://support.google.com/code/contact/billing_quota_increase).

1-org/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ The purpose of this step is to set up top-level shared folders, monitoring and n
6363
3. Membership in the security admins group for the user running Terraform.
6464
4. Security Command Center notifications require that you choose a Security Command Center tier and create and grant permissions for the Security Command Center service account as outlined in [Setting up Security Command Center](https://cloud.google.com/security-command-center/docs/quickstart-security-command-center)
6565

66-
Note: Make sure that you use the same version of Terraform throughout this
66+
**Note:** Make sure that you use the same version of Terraform throughout this
6767
series, otherwise you might experience Terraform state snapshot lock errors.
6868

69+
### Troubleshooting
70+
71+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
72+
6973
## Usage
7074

7175
**Disclaimer:** This step enables [Data Access logs](https://cloud.google.com/logging/docs/audit#data-access) for all services in your organization.

2-environments/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ The purpose of this step is to setup development, non-production, and production
6363
1. Cloud Identity / Google Workspace group for monitoring admins.
6464
1. Membership in the monitoring admins group for user running Terraform.
6565

66+
### Troubleshooting
67+
68+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
69+
6670
## Usage
6771

6872
### Deploying with Cloud Build

3-networks/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ The purpose of this step is to:
6464
1. 0-bootstrap executed successfully.
6565
1. 1-org executed successfully.
6666
1. 2-environments executed successfully.
67-
1. Obtain the value for the access_context_manager_policy_id variable. Can be obtained by running `gcloud access-context-manager policies list --organization YOUR_ORGANIZATION_ID --format="value(name)"`.
67+
1. Obtain the value for the access_context_manager_policy_id variable. Can be obtained by running
68+
69+
```
70+
gcloud access-context-manager policies list --organization YOUR_ORGANIZATION_ID --format="value(name)"
71+
```
72+
73+
### Troubleshooting
74+
75+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
6876

6977
## Usage
7078

4-projects/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ This pipeline can be utilized for deploying resources in projects across develop
7575
gcloud access-context-manager perimeters list --policy ACCESS_CONTEXT_MANAGER_POLICY_ID --format="value(name)"
7676
```
7777

78-
**Troubleshooting:**
79-
If you do not have access to run the commands above and you are in the organization admins group, you can append `--impersonate-service-account=org-terraform@<SEED_PROJECT_ID>.iam.gserviceaccount.com` to run the command as the Terraform service account.
80-
8178
**Note:** If you have more than one service perimeter for each environment, you can also get the values from the `restricted_service_perimeter_name` output from each of the`3-networks` environments.
8279

8380
If you are using Cloud Build you can also search for the values in the outputs from the build logs:
@@ -101,6 +98,10 @@ gcloud builds log BUILD_ID \
10198

10299
Change the `BRANCH_NAME` from `development` to `non-production` or `production` for the other two service perimeters.
103100

101+
### Troubleshooting
102+
103+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
104+
104105
## Usage
105106

106107
**Note:** You need to set variable `enable_hub_and_spoke` to `true` to be able to used the **Hub-and-Spoke** architecture detailed in the **Networking** section of the [google cloud security foundations guide](https://services.google.com/fh/files/misc/google-cloud-security-foundations-guide.pdf).

5-app-infra/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ This Compute Engine instance is created using the base network from step `3-netw
7272
1. 3-networks executed successfully.
7373
1. 4-projects executed successfully.
7474

75+
### Troubleshooting
76+
77+
Please refer to [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during this step.
78+
7579
## Usage
7680

7781
### Deploying with Cloud Build

docs/FAQ.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Frequently Asked Questions
2+
3+
## Why am I encountering a low quota with projects created via Terraform Example Foundation?
4+
5+
When you deploy the Terraform Example Foundation with the Service Account created in step 0-bootstrap,
6+
the project quota will be based on the reputation of your service account rather than your user identity.
7+
In many cases, this quota is initially low.
8+
9+
We recommend that your request 50 additional projects for the service account, `terraform_service_account`, created in step 0-bootstrap.
10+
You can use the [Request Project Quota Increase](https://support.google.com/code/contact/project_quota_increase) form to request the quota increase.
11+
In the support form, for **Email addresses that will be used to create projects**, use the `terraform_service_account` address that's created in the organization bootstrap module.
12+
If you see other quota errors, see the [Quota documentation](https://cloud.google.com/docs/quota).

docs/GLOSSARY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Glossary
2+
3+
Defined terms in the documentation for Terraform Example Foundation are capitalized and have
4+
specific meaning within the domain of knowledge.
5+
6+
## Terraform Service Account
7+
8+
The email for privileged service account created in the seed project of the step 0-bootstrap.
9+
This service account is used to run Terraform by Cloud Build and Jenkins using service account impersonation.
10+
11+
## Seed Project
12+
13+
Seed Project created in the 0-bootstrap step. It is the project where the Terraform Service Account (`terraform_service_account`) is created and hosts the GCS bucket used to store Terraform state of each environment in subsequent phases.
14+
15+
## Foundation Pipeline
16+
17+
A project created in step 0-bootstrap to manage infrastructure **within the organization**.
18+
The pipeline can use **Cloud Build** or **Jenkins** depending or your context and Terraform is executed using the seed project service account.
19+
Also know as the CI/CD project.
20+
It is located under folder `bootstrap`.
21+
22+
## App Infra Pipeline
23+
24+
A project created in step 4-projects to host a Cloud Build pipeline configured to manage infrastructure **within projects**.
25+
A separate pipeline exists for each of the business units and it can be configured to use a service account that has limited permissions to deploy into certain projects created in 4-projects.
26+
They are located under folder `common`.

0 commit comments

Comments
 (0)