Skip to content

Step 5 - Tenant: post terraforming

Note

This step is done by the tenant administrators.

Set up domain-wide delegation (in tenant admin.google.com)

Nais performs some operations on behalf of the Nais admin user mentioned above. For this to work the, this user needs domain-wide delegation with some scopes. This must be manually set up in the Google Admin console:

  1. Go to https://admin.google.com/ac/owl/domainwidedelegation
  2. Get the client ID of the tenant directory service account
    Using gcloud
    MANAGEMENT_PROJECT_ID=<tenant management project>
    gcloud iam service-accounts --project=$MANAGEMENT_PROJECT_ID describe tenant-directory-sa@$MANAGEMENT_PROJECT_ID.iam.gserviceaccount.com --format="value(uniqueId)"
    
  3. Click on Add new to add a new Client ID
  4. Add the following scopes:
    • https://www.googleapis.com/auth/admin.directory.group
    • https://www.googleapis.com/auth/admin.directory.user.readonly
  5. Click on Authorize

After this is done you should see something like the following:

Screenshot of the Domain-wide Delegation screen in the Google Admin console

  1. We recommend enabling Google Access Approval for your organization. This will log Google Access to your resources and require Google to get approval before accessing them.

Export billing data (tenants with their own billing account)

To present your cost data in Nais Console, your Cloud Billing data must be exported to a BigQuery dataset.

  1. Set up Cloud Billing data export to BigQuery
    • We recommend creating a dedicated project for this export
    • Enable the Detailed usage cost data export
  2. When the dataset is created, grant nais-billing@nais.io the BigQuery Data Viewer role on the dataset
  3. Notify the Nais team and include the project ID and dataset name