-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
According to this document, I have two dotenv files, .env and .env.temp-project, which PROJECT_ID store in .env.temp-project
It looks like it only loads .env, and if I set PROJECT_ID in .env, it will use value from .env, not .env.temp-project, which is not correct since I want to set a service account for each environment. As a result, I tried to set a variable, which is shown below, but it gave an error.
Code
from firebase_functions import pubsub_fn, params
import os
REGION = os.environ.get("REGION")
PUBSUB_TOPIC_NAME = os.environ.get("PUBSUB_TOPIC_NAME")
PROJECT_ID = params.StringParam("PROJECT_ID")
@pubsub_fn.on_message_published(
topic=PUBSUB_TOPIC_NAME,
region=REGION,
service_account=f"test@{PROJECT_ID}.iam.gserviceaccount.com",
memory=16384,
timeout_sec=540,
cpu=8,
)
def Test(
event: pubsub_fn.CloudEvent[pubsub_fn.MessagePublishedData],
) -> None:
# Code
⚠ functions: HTTP Error: 400, projects/-/serviceAccounts/test@{{ params.PROJECT_ID }}.iam.gserviceaccount.com should be a valid email or unique ID.
how to resolve this issue
Metadata
Metadata
Assignees
Labels
No labels