brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.05k stars 364 forks source link

Symfony CLI DATABASE_URL Not Found #1779

Closed gusdecool closed 3 months ago

gusdecool commented 3 months ago

Description:

I tried the bref:cli for symfony. But for some reason it didn't read the DATABASE_URL env. Just that ENV.

my .env file

DATABASE_URL="FAKE"
TEST=FOO

When I ran command

serverless bref:cli --stage=dev --args="debug:dotenv"

It only listed env TEST, but not the DATABASE_URL.

How to reproduce:

Package used

        "symfony": "6.4.x"
        "bref/bref": "^2.1", (2.1.19)
        "bref/symfony-bridge": "^0.2.2", (0.2.2)
gusdecool commented 3 months ago

Nevermind, looks like i got the cause. That because in serverless.yml file I put the environment

provider:
  ....
  environment:
    APP_ENV: ${sls:stage}
    DATABASE_URL: FOOO

so if I called the bref:cli dot:env. It didn't list the DATABASE_URL. This probably for security reason.

But will be great if bref show it as <redacted>