As a cloud administrator or a cloud account owner, you can onboard all GCP accounts under a GCP organization.
Prerequisites
- Locate and record the Org ID by logging into the Google Cloud Platform and selecting the organization.
- Locate and record the Project ID.
Procedure
- On the left navigation pane, click .
- On the Public Cloud Accounts page, click Add Account.
The
Add Public Cloud Account window displays.
- Under Cloud Provider, select GCP. Under Method, select Organization (multi accounts). Click Next.
- Enter the Project ID and run the provided script in Google Cloud Shell together with the organization ID to create a service account key.
curl https://dev.cwp.cbdtest.io/public-cloud/dev01/gcp/pre-
onboarding-setup/shell/setup-trust-relationship-multi-
account.sh -o setup-trust-relationship-multi-account.sh &&
bash setup-trust-relationship-multi-account.sh --
CBAwsAccountId xxxxxxxxxxxx --CBAwsRoleName mcs2-app-kcdev01-
pub-cloud-gcp-service-role --GCPProjectId Test --
OrganizationId <GCP_Org_ID>
The output provides the project number, service account email, Identity pool ID, and Identity provider ID.
- Using the provided details, fill in the Connect Service Account Fields.
- Select and enter the details in the Account Details fields and click Next.
- Use the search text box to narrow the results, select the accounts to onboard, and click Next.
Note: The org account is the management account. All other accounts are member accounts.
- Depending on your selections, copy and run the script in Google Cloud Shell:
- To onboard all accounts, in the Google Console, navigate to the service account within the Master account. Select Permissions and add the Service Account Token Creator permission to the user account that is running the script. Copy and run the script in Google Cloud Shell.
- To onboard one or more individual accounts, copy and run the script in Google Cloud Shell.
- (Optional) Enable Event Streaming by copying the provided command and running it in Google Cloud Shell.
- Click Add Account to onboard the selected accounts.
Results
The newly added GCP accounts display at the top of the listed projects on the
Public Cloud Accounts page. Refresh the page to see the status change from
In Progress
to
Activ
e after validation completes. All of the resources that are associated with these projects are available on the
page.