Skip to content

Commit

Permalink
Add project ID and build secret separately
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Oct 24, 2023
1 parent 5935f45 commit 1618052
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions stack/cloud_function_ais_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
),
)

gfw_credentials = cloudfunctions.FunctionSecretEnvironmentVariableArgs(
key="GOOGLE_APPLICATION_CREDENTIALS",
secret=pulumi.Config("ais").require("credentials"),
version="latest",
project_id=pulumi.Config("gcp").require("project"),
)

fxn = cloudfunctions.Function(
function_name,
name=function_name,
Expand All @@ -89,13 +96,7 @@
service_account_email=cloud_function_service_account.email,
available_memory_mb=1024,
timeout=540,
secret_environment_variables=[
cloudfunctions.FunctionSecretEnvironmentVariableArgs(
key="GOOGLE_APPLICATION_CREDENTIALS",
secret=pulumi.Config("ais").require("credentials"),
version="latest",
)
],
secret_environment_variables=[gfw_credentials],
)

invoker = cloudfunctions.FunctionIamMember(
Expand Down

0 comments on commit 1618052

Please sign in to comment.