runtime / bref-layer
Installs: 79 884
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 0
Open Issues: 0
Requires (Dev)
- async-aws/core: ^1.7
- async-aws/lambda: ^1.1
- bref/logger: ^1.0
- mnapoli/silly: ^1.7
- mnapoli/silly-php-di: ^1.2
- symfony/finder: ^5.2
- symfony/http-client: 5.3.8
- symfony/process: ^5.2
- dev-main
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.25
- 2.1.24
- 2.1.23
- 2.1.22
- 2.1.21
- 2.1.20
- 2.1.19
- 2.1.18
- 2.1.17
- 2.1.16
- 2.1.15
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.0.0-beta17
- 2.0.0-beta16
- 2.0.0-beta15
- 2.0.0-beta14
- 2.0.0-beta13
- 2.0.0-beta11
- 2.0.0-beta10
- 2.0.0-beta9
- 2.0.0-beta8
- 2.0.0-beta7
- 2.0.0-beta6
- 2.0.0-beta5
- 2.0.0-beta4
- 1.7.13
- 1.7.12
- 1.7.11
- 1.7.10
- 1.7.9
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.3
- 1.3.2
This package is auto-updated.
Last update: 2024-12-20 16:18:55 UTC
README
This repository provides Bref layers to run Symfony Runtime applications on AWS Lambda. It is automatically updated to sync with the changes in Bref. These layers are just replacing Bref's "function layer" with a new boostrap file. See the Dockerfile.
You will find more information how to run your applicaiton with the runtime component at https://github.com/php-runtime/bref
Install and configure
composer require runtime/bref-layer
# serverless.yml service: appgit init provider: name: aws region: us-east-1 runtime: provided.al2 plugins: - ./vendor/runtime/bref-layer # <----- Add the extra Serverless plugin functions: website: handler: public/index.php layers: - ${runtime-bref:php-82} events: - httpApi: '*'
You will use the same layer for console applications, PSR-11, PSR-15, Laravel or Symfony applications. Anything the Runtime component supports.
Available layers
These are the available layers:
${runtime-bref:php-82}
${runtime-bref:php-81}
${runtime-bref:php-80}
${runtime-bref:php-74}
${runtime-bref:php-73}
FAQ
Can I use custom php extensions?
Yes, you can. See the bref/extra-php-extensions
package.
Do I need to install bref/bref?
The bref/bref
package includes both layers
and a lot of features to make it easier to write applications on AWS Lambda.
You do not have to include bref/bref
if you only want the layers. But most
HTTP applications probably will.
Why not include this package in bref/bref?
There is an open PR to do just that. There is also an open PR to make the function layer support the runtime component natively.
Until any of these PRs are merged, we have this layer to help making a good experience as possible for the runtime users.
Why not use the layer from bref/extra-php-extensions?
The bref/extra-php-extensions
has a layer called ${bref-extra:symfony-runtime-php-74}
. It adds the custom bootstrap
file needed for the Runtime component.
AWS has a hard limit on max 5 layers per function. So instead of using two layers
(${bref:layer.php-80}
+ ${bref-extra:symfony-runtime-php-74}
) one can use only
${runtime-bref:php-80}
.
What is your relation to Bref?
We LOVE Bref. They are the best ever. Consider sponsoring Matthieu Napoli for his work.
Maintainer notes
Testing the layer
# Test all layers and PHP versions
make test
# Test only a single layer
layer=bref make test
# Test a single layer on a single PHP version
layer=bref php_versions=74 make test
Deploy new versions
The manual way
export AWS_PROFILE=my_profile
make publish
git add layers.json
git commit -m "New version of layers"
git push
Lambda layers in details
Notice: this section is only useful if you want to learn more.
The lambda layers follow this pattern:
arn:aws:lambda:<region>:403367587399:layer:bref-<layer-name>:<layer-version>
See the latest layer versions.