-
Notifications
You must be signed in to change notification settings - Fork 4
[DCP Ingestion] Connect the CDC Data Job to the ingestion workflow #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,8 @@ resource "google_project_iam_member" "datacommons_service_account_roles" { | |
| "roles/vpcaccess.user", | ||
| "roles/iam.serviceAccountUser", | ||
| "roles/secretmanager.secretAccessor", | ||
| "roles/spanner.databaseUser" | ||
| "roles/spanner.databaseUser", | ||
| "roles/workflows.invoker" | ||
| ]), var.use_spanner ? [] : ["roles/spanner.databaseUser"]) | ||
| project = var.project_id | ||
| member = "serviceAccount:${google_service_account.datacommons_service_account.email}" | ||
|
|
@@ -46,3 +47,17 @@ resource "google_secret_manager_secret_version" "maps_api_key_version" { | |
| secret = google_secret_manager_secret.maps_api_key[0].id | ||
| secret_data = local.maps_api_key | ||
| } | ||
|
|
||
| resource "google_storage_bucket_iam_member" "cdc_data_bucket_access" { | ||
| bucket = google_storage_bucket.data_bucket.name | ||
| role = "roles/storage.objectAdmin" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
| member = "serviceAccount:${google_service_account.datacommons_service_account.email}" | ||
| } | ||
|
|
||
| resource "google_storage_bucket_iam_member" "dataflow_bucket_access" { | ||
| bucket = google_storage_bucket.data_bucket.name | ||
| role = "roles/storage.objectAdmin" | ||
| member = "serviceAccount:${local.name_prefix}dcp-ingestion-sa@${var.project_id}.iam.gserviceaccount.com" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Constructing the service account email as a string literal creates a tight coupling between the |
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ variable "dcp_spanner_database_id" { | |
| variable "dcp_spanner_processing_units" { | ||
| description = "Spanner units for DCP" | ||
| type = number | ||
| default = 100 | ||
| default = 1000 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Increasing the default References
|
||
| } | ||
|
|
||
| variable "dcp_service_cpu" { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for conditionally granting
roles/spanner.databaseUserappears to be incorrect. The role is currently included in the static list and then concatenated again ifvar.use_spanneris false, meaning it is granted regardless of the setting. If Spanner access should be conditional, the role should be removed from the static list and the ternary logic should be corrected tovar.use_spanner ? ["roles/spanner.databaseUser"] : [].