0.5.0-beta1
Pre-releaseFirst beta release for v0.5. This is a "major" version without BC break, but with major changes that affect the usage of Bref.
This is a beta version, please test and report any problem. Note that the new documentation hasn't been published yet because this is not a stable release.
Switching from SAM to Serverless
AWS SAM is being replaced by Serverless as the tool to configure and deploy applications.
This is a major change because:
- Bref now recommends Serverless instead of SAM
- the documentation has been rewritten around Serverless
- tooling has been added around Serverless
SAM will continue to work with Bref, just like CloudFormation, Terraform, Now (#368), etc. Bref layers are independent of the tooling used. If you have created applications with SAM, you can keep using it. Most of the time however migrating template.yaml
to serverless.yml
is not too complex (migrating a production stack may be more effort).
Why?
Serverless offers a configuration format (serverless.yml
) that is much simpler and more concise (#320). Sometimes serverless.yml
is twice less YAML than template.yaml
for the same application.
Another major simplification is that the stack name and the region are configured inside serverless.yml
. Deploying no longer take 3 steps and 10 lines of code, but only 2 words:
# Before
aws s3 mb s3://<bucket-name>
sam package \
--output-template-file .stack.yaml \
--region eu-west-1 \
--s3-bucket <bucket-name>
sam deploy \
--template-file .stack.yaml \
--region eu-west-1 \
--capabilities CAPABILITY_IAM \
--stack-name <stack-name>
# After
serverless deploy
On top of that, Serverless offers a plugin system that lets us simplify a lot of things, especially around Bref (#351). For example, using Bref layers is now much simpler:
# Before
functions:
foo:
handler: index.php
layers:
- 'arn:aws:lambda:us-east-1:209497400698:layer:php-73:7'
# After
functions:
foo:
handler: index.php
layers:
- ${bref:layer.php-73}
Layer version numbers are now tied to a specific Bref version, and we no longer need to mess with the AWS region name. Upgrading layers is now as simple as upgrading Bref via Composer.
Additionally, serverless deploy
can deploy the same application in multiple stages.
Finally, Serverless offers a lot of plugins: https://serverless.com/plugins/