File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
airflow/plugins/operators
iac/cal-itp-data-infra-staging/composer/us Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ def PodOperator(*args, **kwargs):
1616 if "secrets" in kwargs :
1717 kwargs ["secrets" ] = map (lambda d : Secret (** d ), kwargs ["secrets" ])
1818
19+ if "SERVICE_ACCOUNT_NAME" in os .environ :
20+ kwargs ["service_account_name" ] = os .environ .get ("SERVICE_ACCOUNT_NAME" )
21+
1922 location = os .environ .get ("POD_LOCATION" )
2023 cluster_name = os .environ .get ("POD_CLUSTER_NAME" )
2124 project_id = os .environ .get ("GOOGLE_CLOUD_PROJECT" )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ resource "google_composer_environment" "calitp-staging-composer" {
5555 " POD_LOCATION" = " us-west2" ,
5656 " POD_CLUSTER_NAME" = data.terraform_remote_state.gke.outputs.google_container_cluster_airflow- jobs- staging_name,
5757 " POD_SECRETS_NAMESPACE" = local.namespace,
58- " SERVICE_ACCOUNT_NAME" = data.terraform_remote_state.iam.outputs.google_service_account_composer - service - account_email ,
58+ " SERVICE_ACCOUNT_NAME" = local.service_account_name ,
5959 " CALITP_BUCKET__AGGREGATOR_SCRAPER" = " gs://${ data . terraform_remote_state . gcs . outputs . google_storage_bucket_calitp-staging-aggregator-scraper_name } " ,
6060 " CALITP_BUCKET__AIRTABLE" = " gs://${ data . terraform_remote_state . gcs . outputs . google_storage_bucket_calitp-staging-airtable_name } " ,
6161 " CALITP_BUCKET__AMPLITUDE_BENEFITS_EVENTS" = " gs://${ data . terraform_remote_state . gcs . outputs . google_storage_bucket_calitp-staging-amplitude-benefits-events_name } " ,
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ resource "kubernetes_priority_class" "dbt-high-priority" {
3838
3939resource "kubernetes_service_account" "composer-service-account" {
4040 metadata {
41- name = " composer-service-account "
41+ name = local . service_account_name
4242 namespace = local. namespace
4343 annotations = {
4444 " iam.gke.io/gcp-service-account" = data.terraform_remote_state.iam.outputs.google_service_account_composer- service- account_email
Original file line number Diff line number Diff line change 11locals {
2- namespace = " airflow-jobs"
3- secret = " jobs-data"
2+ namespace = " airflow-jobs"
3+ secret = " jobs-data"
4+ service_account_name = " composer-service-account"
45
56 # This regular expression corresponds to the Python package name specification
67 # https://packaging.python.org/en/latest/specifications/name-normalization/
You can’t perform that action at this time.
0 commit comments