Skip to content

Parameterized configuration is not working #164

@RTae

Description

@RTae

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions