Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions src/bref/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,33 @@ Define the environment variable `APP_RUNTIME` for your application on Lambda.

## How to use

You need the extra lambda layer `arn:aws:lambda:[region]:403367587399:layer:bref-sf-runtime:1`
in serverless.yml.

```yaml
# serverless.yml

# ...

functions:
app:
handler: public/index.php
timeout: 8
layers:
- ${bref:layer.php-74}
- arn:aws:lambda:eu-central-1:403367587399:layer:bref-sf-runtime:1
events:
- httpApi: '*'
You need a new "bootstrap" file for AWS Lambda. That file should look like
[this](https://github.com/brefphp/extra-php-extensions/blob/master/layers/symfony-runtime/bootstrap).
The simplest way is to use the `${bref-extra:symfony-runtime-php-80}` from the
[bref/extra-php-extension package](https://github.com/brefphp/extra-php-extensions).

```diff
# serverless.yml

# ...

functions:
app:
handler: public/index.php
timeout: 8
layers:
- ${bref:layer.php-74}
+ - ${bref-extra:symfony-runtime-php-80}
events:
- httpApi: '*'
```

(You may also copy that bootstrap file yourself and place it in your project root.)

### Symfony application

Use the standard Symfony 5.3+ index.php.

```php
// public/index.php

Expand All @@ -64,7 +70,6 @@ return function (array $context) {
};
```


### PSR-15 application

```php
Expand Down Expand Up @@ -120,6 +125,8 @@ to serverless.yml

### Console application

Use the standard Symfony 5.3+ bin/console.

```php
// bin/console

Expand Down