| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The Bref plugin sets this variable on `serverless.yml` deployments (brefphp/bref#2184), and Bref Cloud on `bref.php` deployments (brefphp/cloud#388). CDK applications get the same variable, unless they set it themselves. Claude-Session: https://claude.ai/code/session_01MAbMtQ3io736HaRVpwKzCD
| Back | FazBrowse Home | New Git URL |
Bref now sets a BREF_STACK_NAME environment variable containing the stack name on all functions deployed with serverless.yml (brefphp/bref#2184) and with Bref Cloud's bref.php (brefphp/cloud#388). This PR does the same for CDK applications, so that the variable is available whatever the deployment method.
With the stack name, an application can find resources named after the stack. For example, the Laravel bridge exposes it as config('bref.stack_name') (brefphp/laravel-bridge#211) to route Laravel queue names to SQS queues with Queue::forward(). With CDK, that only works if the application names its SQS queues <stack>-<name>, like Lift and Bref Cloud do.
PhpFunction and PhpFpmFunction set it to Stack.of(this).stackName, and ConsoleFunction inherits it from PhpFunction. A BREF_STACK_NAME passed in the function's environment is kept, like with the plugin.