This code is not compatible with Bref CDK constructs:
const app = new App();
new MyStack(app, `my-stack-dev`);
Why? Bref automatically set the Bref Lambda layer on your functions. But to do that, Bref needs to know the AWS region to pick the right Bref layer ARN. When you don't set the region explicitly, then Bref cannot access the region (the region variable actually returns the ${AWS:Region}
CloudFormation variable, which is useless for Bref).
To fix this, you must set the region
explicitly on your stack:
const app = new App();
new MyStack(app, `my-stack-dev`, {
// 👇 we are explicitly setting the region
env: {
region: 'us-east-1',
}
});