Skip to content

Commit

Permalink
try secret manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Nov 26, 2023
1 parent e889776 commit 4c2c372
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
4 changes: 3 additions & 1 deletion stack/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
pulumi.export("historical_run_url", cloud_function_historical_run.fxn.https_trigger_url)
pulumi.export("ais_analysis_url", cloud_function_ais_analysis.fxn.https_trigger_url)
pulumi.export("sns_topic_subscription", sns_subscription.sentinel1_sqs_target.arn)
pulumi.export("api_key", pulumi.Config("cerulean-cloud").require("titiler_apikey"))
pulumi.export(
"titiler_api_key", pulumi.Config("cerulean-cloud").require("titiler_apikey")
)
12 changes: 7 additions & 5 deletions stack/cloud_run_offset_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
),
)

cloud_function_service_account_iam = gcp.projects.IAMMember(
construct_name("cloud-run-offset-tile-secretmanagerSecretAccessor"),
project=pulumi.Config("gcp").require("project"),
# IAM Binding for Secret Manager access
secret_accessor_binding = gcp.secretmanager.SecretIamMember(
construct_name("cloud-run-offset-tile-secret-accessor-binding"),
secret_id=pulumi.Config("cerulean-cloud").require("keyname"),
role="roles/secretmanager.secretAccessor",
member=cloud_function_service_account.email.apply(
lambda email: f"serviceAccount:{email}"
member=pulumi.Output.concat(
"serviceAccount:", cloud_function_service_account.email
),
opts=pulumi.ResourceOptions(depends_on=[cloud_function_service_account]),
)

service_name = construct_name("cloud-run-offset-tiles")
Expand Down
12 changes: 7 additions & 5 deletions stack/cloud_run_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@
),
)

cloud_function_service_account_iam = gcp.projects.IAMMember(
construct_name("cloud-run-orchestrator-secretmanagerSecretAccessor"),
project=pulumi.Config("gcp").require("project"),
# IAM Binding for Secret Manager access
secret_accessor_binding = gcp.secretmanager.SecretIamMember(
construct_name("cloud-run-orchestrator-secret-accessor-binding"),
secret_id=pulumi.Config("cerulean-cloud").require("keyname"),
role="roles/secretmanager.secretAccessor",
member=cloud_function_service_account.email.apply(
lambda email: f"serviceAccount:{email}"
member=pulumi.Output.concat(
"serviceAccount:", cloud_function_service_account.email
),
opts=pulumi.ResourceOptions(depends_on=[cloud_function_service_account]),
)


Expand Down
12 changes: 7 additions & 5 deletions stack/cloud_run_tipg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
),
)

cloud_function_service_account_iam = gcp.projects.IAMMember(
construct_name("cloud-run-tipg-secretmanagerSecretAccessor"),
project=pulumi.Config("gcp").require("project"),
# IAM Binding for Secret Manager access
secret_accessor_binding = gcp.secretmanager.SecretIamMember(
construct_name("cloud-run-tipg-secret-accessor-binding"),
secret_id=pulumi.Config("cerulean-cloud").require("keyname"),
role="roles/secretmanager.secretAccessor",
member=cloud_function_service_account.email.apply(
lambda email: f"serviceAccount:{email}"
member=pulumi.Output.concat(
"serviceAccount:", cloud_function_service_account.email
),
opts=pulumi.ResourceOptions(depends_on=[cloud_function_service_account]),
)

service_name = construct_name("cloud-run-tipg")
Expand Down

0 comments on commit 4c2c372

Please sign in to comment.