Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterized configuration is not working #164

Closed
RTae opened this issue Nov 27, 2023 · 1 comment
Closed

Parameterized configuration is not working #164

RTae opened this issue Nov 27, 2023 · 1 comment

Comments

@RTae
Copy link

RTae commented Nov 27, 2023

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

@RTae
Copy link
Author

RTae commented Nov 28, 2023

Open new ticket
firebase/firebase-tools#6550

@RTae RTae closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant