Skip to content

Commit eb53c08

Browse files
authored
Add link to DfE Analytics terraform docs from setup readme. (#190)
* Add link to DfE Analytics terraform docs from setup readme * Add Terraform Automation regarding setup for datasets, events table and service accounts
1 parent 10c5dcd commit eb53c08

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

docs/google_cloud_bigquery_setup.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ be leaked.
453453
> **NB:** It may be easier to perform these instructions with two browser tabs
454454
> open, one for BigQuery and the other for IAM
455455
456+
### Terraform Automation
457+
458+
The per project setup for datasets, events table and service accounts should be automated through terraform and this should be the preferred option. See the [dfe analytics terraform documentation](https://github.com/DFE-Digital/terraform-modules/blob/main/aks/dfe_analytics/README.md#create-new-dataset-and-events-table) for instructions on how to do this.
459+
460+
If datasets, events table and service accounts have been setup using terraform, then steps 1, 2, 3 and 4 below can be skipped, otherwise manual setup will be required as described in these steps.
461+
456462
### 1. Create dataset(s)
457463

458464
Start by creating a dataset.
@@ -523,7 +529,7 @@ With dfe-analytics our strong preference is to use WIF where possible. Where WIF
523529

524530
The diagram below demonstrates our use of WIF within dfe-analytics connecting from an Azure client to BigQuery.
525531

526-
![[azure-gcp-wif.svg]]
532+
<img src="https://raw.githubusercontent.com/DFE-Digital/dfe-analytics/refs/heads/main/docs/azure-gcp-wif.svg">
527533

528534
The steps below outline how to setup WIF for service accounts using either gcloud shell scripts or gcloud console.
529535

@@ -555,21 +561,27 @@ For each project a workload identity pool provider with the name `azure-cip-oidc
555561

556562
If this does not exist then one can be created with either the [create gcp workload identity pool provider](https://github.com/DFE-Digital/teacher-services-analytics-cloud/blob/main/scripts/gcloud/create-gcp-workload-identity-pool-provider.sh) gcloud script or from the [IAM](https://console.cloud.google.com/iam-admin/workload-identity-pools/pool/azure-cip-identity-pool) gcloud console using the attributes specified in the gcloud script.
557563

558-
### 4. Service account
564+
### 4. Terraform automation
565+
566+
The per project setup for WIF service accounts, permissions and client credentials should be automated through terraform and this should be the preferred option. See the [dfe analytics terraform documentation](https://github.com/DFE-Digital/terraform-modules/blob/main/aks/dfe_analytics/README.md) for instructions on how to do this.
567+
568+
If WIF has been setup using terraform, then steps 5, 6 and 7 below can be skipped, otherwise manual setup will be required as described in these steps.
569+
570+
### 5. Service account
559571

560572
A service account with the correct permissions on the events table should exist.
561573

562574
If this does not exist then follow the steps above:
563575
- [Create an appender service account](#3-create-an-appender-service-account)
564576
- [Give the service account access to your dataset](#3-create-an-appender-service-account)
565577

566-
### 5. Service account permissions for workload identity federation
578+
### 6. Service account permissions for workload identity federation
567579

568580
The service account defined in step 4 above should be granted access using service account impersonation.
569581

570582
If this does not exist then access can be granted with either the [update wif service account permissions ](https://github.com/DFE-Digital/teacher-services-analytics-cloud/blob/main/scripts/gcloud/update-wif-service-account-permissions.sh) gcloud script or from the [IAM](https://console.cloud.google.com/iam-admin/workload-identity-pools/pool/azure-cip-identity-pool) gcloud console, by navigating to the "GRANT ACCESS" window. Use the attributes specified in the gcloud script. Note that the subject must be set to the Managed Identity Object ID from Azure for each environment (see Step 1 above).
571583

572-
### 6. Download the WIF client credentials
584+
### 7. Download the WIF client credentials
573585

574586
Download the JSON WIF Credentials file and set to following environment variables to the content of this file:
575587

0 commit comments

Comments
 (0)