You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Provide a default `serverless.yml` with FPM by default
* Move Bref initialization code in the service provider so that it applies to all runtime types
* Enable direct deployments by default because they are faster
* Remove the population of env vars from SSM parameters
This is a native Bref feature since Bref 2.0.
* Remove `deploymentMethod` as it is set by default in Bref 2.0
* Run `config:cache` on cold starts using the new Bref hooks
* Simplify the Octane handler
* Simplify the Octane runtime usage
* Make sure file handlers are still supported
* flatten
* inline
* formatting
* fix
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
## [v2.0.0]
8
8
### Breaking Changes
9
9
- Logs are now written in plain text by default instead of JSON. To enable JSON logs, set `channels.stderr.formatter` to `Monolog\Formatter\JsonFormatter::class` in `config/logging.php`.
10
+
- The automatic population of environment variables via `APP_SSM_PREFIX` and `APP_SSM_PARAMETERS` has been removed. The native Bref 2.0 feature to load SSM parameters into environment variables can be used instead ([#36](https://github.com/cachewerk/bref-laravel-bridge/pull/36))
11
+
- If you use Octane, remove the `bref/runtime.php` file, remove the `APP_RUNTIME` environment variable (in `serverless.yml`) and set your Octane function handler to: `handler: CacheWerk\BrefLaravelBridge\Http\OctaneHandler`.
By default the runtime is published to `php/` where Bref's PHP configuration resides, but it can be move anywhere.
31
+
This will create the `serverless.yml` config file.
32
32
33
33
Next, we need to set up in the `AWS_ACCOUNT_ID` environment variable in your `serverless.yml`:
34
34
@@ -38,67 +38,62 @@ provider:
38
38
AWS_ACCOUNT_ID: ${aws:accountId}
39
39
```
40
40
41
-
Then set up your functions:
41
+
Finally, deploy your app:
42
42
43
-
```yml
44
-
functions:
45
-
web:
46
-
handler: php/runtime.php
47
-
environment:
48
-
APP_RUNTIME: octane
49
-
BREF_LOOP_MAX: 250
50
-
layers:
51
-
- ${bref:layer.php-81}
52
-
events:
53
-
- httpApi: '*'
43
+
```bash
44
+
serverless deploy
45
+
```
54
46
55
-
queue:
56
-
handler: php/runtime.php
57
-
timeout: 59
58
-
environment:
59
-
APP_RUNTIME: queue
60
-
layers:
61
-
- ${bref:layer.php-81}
62
-
events:
63
-
- sqs:
64
-
arn: !GetAtt Queue.Arn
65
-
batchSize: 1
66
-
maximumBatchingWindow: 60
67
-
68
-
cli:
69
-
handler: php/runtime.php
70
-
timeout: 720
71
-
environment:
72
-
APP_RUNTIME: cli
73
-
layers:
74
-
- ${bref:layer.php-81}
75
-
- ${bref:layer.console}
76
-
events:
77
-
- schedule:
78
-
rate: rate(1 minute)
79
-
input: '"schedule:run"'
47
+
When running in AWS Lambda, the Laravel application will automatically cache its configuration when booting. You don't need to run `php artisan config:cache` before deploying.
48
+
49
+
You can deploy to different environments (aka "stages") by using the `--stage` option:
50
+
51
+
```bash
52
+
serverless deploy --stage=staging
80
53
```
81
54
82
-
If you don't want to use Octane, simply remove `APP_RUNTIME` and `BREF_LOOP_MAX` from the `web` function.
55
+
Check out some more [comprehensive examples](examples/).
56
+
57
+
## Octane
83
58
84
-
To avoid setting secrets as environment variables on your Lambda functions, you can inject them directly into the Lambda runtime:
59
+
If you want to run the HTTP application with Laravel Octane, you will to change the following options in the `web` function:
0 commit comments