Skip to content

Commit 005009a

Browse files
Merge pull request #123 from wilsenhc/feature/update-lambda-runtimes
Update supported Runtimes
2 parents 5d1e03b + 76f55ac commit 005009a

File tree

8 files changed

+81
-52
lines changed

8 files changed

+81
-52
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ Sidecar packages, creates, deploys, and executes Lambda functions from your Lara
2020

2121
You can write functions in any of the following runtimes and execute them straight from PHP:
2222

23+
- Node.js 20
24+
- Node.js 18
2325
- Node.js 16
24-
- Node.js 14
25-
- Node.js 12
26-
- Node.js 10
26+
- Python 3.12
27+
- Python 3.11
28+
- Python 3.10
2729
- Python 3.9
2830
- Python 3.8
29-
- Python 3.7
30-
- Python 3.6
31-
- Python 2.7
32-
- Ruby 2.7
33-
- Ruby 2.5
31+
- Java 21
32+
- Java 17
3433
- Java 11
3534
- Java 8
36-
- Go 1.x
35+
- .NET 7
3736
- .NET 6
38-
- .NET Core 3.1
39-
- .NET Core 2.1
37+
- Ruby 3.2
38+
- OS-only runtime (Amazon Linux 2023)
39+
- OS-only runtime (Amazon Linux 2)
4040

4141
Any runtime that [Lambda supports](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), you can use!
4242

docs/functions/customization.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@ The only two things _required_ for a Sidecar function are the [package and the h
77

88
Lambda supports multiple languages through the use of runtimes. You can choose any of the following runtimes by returning its corresponding identifier:
99

10+
- Node.js 20: `nodejs20.x`
11+
- Node.js 18: `nodejs18.x`
1012
- Node.js 16: `nodejs16.x`
11-
- Node.js 14: `nodejs14.x`
12-
- Node.js 12: `nodejs12.x`
13-
- Node.js 10: `nodejs10.x`
13+
- Python 3.12: `python3.12`
14+
- Python 3.11: `python3.11`
15+
- Python 3.10: `python3.10`
16+
- Python 3.9: `python3.9`
1417
- Python 3.8: `python3.8`
15-
- Python 3.7: `python3.7`
16-
- Python 3.6: `python3.6`
17-
- Python 2.7: `python2.7`
18-
- Ruby 2.7: `ruby2.7`
19-
- Ruby 2.5: `ruby2.5`
18+
- Java 21: `java21`
19+
- Java 17: `java17`
2020
- Java 11: `java11`
21-
- Java 8: `java8`
22-
- Go 1.x: `go1.x`
23-
- .NET Core 3.1: `dotnetcore3.1`
24-
- .NET Core 2.1: `dotnetcore2.1`
21+
- Java 8: `java8.al2`
22+
- .NET 7: `dotnet7`
23+
- .NET 6: `dotnet6`
24+
- Ruby 3.2: `ruby3.2`
25+
- OS-only runtime (Amazon Linux 2023): `provided.al2023`
26+
- OS-only runtime (Amazon Linux 2): `provided.al2`
2527

26-
E.g. to use the Go runtime, you would return `go1.x`:
28+
E.g. to use the Python 3.12 runtime, you would return `python3.12`:
2729

2830
```php
2931
class ExampleFunction extends LambdaFunction
3032
{
3133
public function runtime() // [tl! focus:3]
3234
{
33-
return 'go1.x';
35+
return 'python3.12';
3436
}
3537
}
3638
```

docs/functions/deploying.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When you run that, you'll see an output log similar to the one below:
2222
↳ Activating Version 1 of SC-Laravel-local-Sidecar-OgImage.
2323
```
2424

25-
The deployment process consists of
25+
The deployment process consists of
2626
- zipping the handler code
2727
- uploading the zip file to S3
2828
- creating the Lambda function if it doesn't exist
@@ -37,7 +37,7 @@ There are two required steps in order to make your functions live and usable.
3737

3838
Because your handler code may require you to `npm install`, `bundle install`, or something similar, you may be building and deploying your handler code in CI or from your local computer.
3939

40-
Once that handler code is all bundled and deployed to Lambda, there may be a secondary step required to deploy your main application.
40+
Once that handler code is all bundled and deployed to Lambda, there may be a secondary step required to deploy your main application.
4141

4242
During this secondary step, your Lambda functions are going to be updated but your application code will not be, which could lead to errors for your users.
4343

@@ -75,15 +75,15 @@ environments:
7575
- 'php artisan sidecar:deploy --env=production' # [tl! ~~]
7676
deploy: # [tl! ~~]
7777
- 'php artisan sidecar:activate' # [tl! ~~]
78-
```
78+
```
7979
8080
Your functions would be built and deployed on whatever machine is handling the Vapor deploy process, and then would be activated as Vapor activates your newest application code.
8181
8282
> Note that in this example we're setting the environment to "production" in the build, because it's likely that your "build" step is running in an environment that doesn't have it's ENV set to "production." See below for more details.
8383
8484
## Faking the Environment
85-
86-
Sidecar names your function based on environment, to prevent collisions between local, staging, production, etc. This could pose a problem if you are deploying your production functions from your build or CI server.
85+
86+
Sidecar names your function based on environment, to prevent collisions between local, staging, production, etc. This could pose a problem if you are deploying your production functions from your build or CI server.
8787
8888
If you need to deploy an environment other than the one you are in, you can override the environment from the config by passing an `--env` flag to the Deploy and Activate commands.
8989

@@ -96,7 +96,7 @@ To read more about environments, head to the [Environments section](../environme
9696

9797
## Setting Environment Variables
9898

99-
This is covered in the [Environment Variables](customization#environment-variables) section of the Customization docs, but we'll cover strategies around env vars and deployment here.
99+
This is covered in the [Environment Variables](customization#environment-variables) section of the Customization docs, but we'll cover strategies around env vars and deployment here.
100100

101101
Some of your functions will require environment variables, either from your Laravel application or something completely distinct. In some cases, you may need to set a static variable so that some library will work [(LibreOffice example)](https://github.com/hammerstonedev/sidecar/issues/24):
102102

@@ -159,7 +159,7 @@ Sidecar sets the environment variables _upon activation_. If you are deploying f
159159

160160
Environment variables are set before activation, and before any pre-warming takes place.
161161

162-
And remember! If Sidecar manages the environment variables for a function, it will clobber any changes you make in the AWS UI, so you cannot use both methods simultaneously.
162+
And remember! If Sidecar manages the environment variables for a function, it will clobber any changes you make in the AWS UI, so you cannot use both methods simultaneously.
163163

164164
## Reusing Package Files
165165

@@ -172,15 +172,11 @@ In the event that neither the code nor function configuration have changed, Side
172172
You will see output similar to the following:
173173

174174
```text
175-
[Sidecar] Deploying App\Sidecar\OgImage to Lambda. (Runtime nodejs12.x.)
175+
[Sidecar] Deploying App\Sidecar\OgImage to Lambda. (Runtime nodejs20.x.)
176176
↳ Function already exists, potentially updating code and configuration.
177177
↳ Packaging function code.
178178
↳ Package unchanged, reusing previous code package at s3://sidecar-us-east-2-XXX/sidecar/001-79a5915eaec296be04a0f4fb7cc80e40.zip.
179179
↳ Function code and configuration are unchanged! Not updating anything. [tl! focus]
180180
[Sidecar] Activating function App\Sidecar\OgImage.
181181
↳ Activating Version 1 of SC-Laravel-local-Sidecar-OgImage.
182-
```
183-
184-
185-
186-
182+
```

docs/functions/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The following four methods are available to you on every Sidecar function:
1111
- `beforeActivation`
1212
- `afterActivation`
1313

14-
## Example: Before Deployment
14+
## Example: Before Deployment
1515

1616
The `beforeDeployment` hook is a great place to run a build step if your function requires it. We'll be using the `ncc build` command mentioned in the [Handlers & Packages](handlers-and-packages#compiling-your-handler-with-ncc) section for this example.
1717

@@ -44,7 +44,7 @@ With this in place, you'll see something like this in your logs:
4444
```text
4545
[Sidecar] Deploying App\Sidecar\Example to Lambda as `SC-App-local-Sidecar-Example`.
4646
↳ Environment: local
47-
↳ Runtime: nodejs14.x
47+
↳ Runtime: nodejs20.x
4848
↳ Compiling bundle with NCC. [tl! focus]
4949
↳ Running `ncc build resources/lambda/image.js -o resources/lambda/dist` [tl! focus]
5050
↳ Bundle compiled! [tl! focus]

docs/overview.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@ It works with _any_ Laravel 7, 8, 9 or 10 application, hosted _anywhere_, includ
77

88
You can write functions in any of the following runtimes and execute them straight from PHP:
99

10+
- Node.js 20
11+
- Node.js 18
1012
- Node.js 16
11-
- Node.js 14
12-
- Node.js 12
13+
- Python 3.12
14+
- Python 3.11
15+
- Python 3.10
16+
- Python 3.9
1317
- Python 3.8
14-
- Python 3.7
15-
- Ruby 2.7
18+
- Java 21
19+
- Java 17
1620
- Java 11
1721
- Java 8
18-
- Go 1.x
19-
- .NET Core 3.1
22+
- .NET 7
23+
- .NET 6
24+
- Ruby 3.2
25+
- OS-only runtime (Amazon Linux 2023)
26+
- OS-only runtime (Amazon Linux 2)
2027

2128
Any runtime that [Lambda supports](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), you can use!
2229

src/Exceptions/NoFunctionsRegisteredException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class NoFunctionsRegisteredException extends SidecarException
1111
{
12-
public function __construct($message = '', $code = 0, Throwable $previous = null)
12+
public function __construct($message = '', $code = 0, ?Throwable $previous = null)
1313
{
1414
$message = "No Sidecar functions have been configured. \n" .
1515
"Please check your config/sidecar.php file to ensure you have registered your functions. \n" .

src/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class Manager
2424
{
25-
use Macroable, HandlesLogging, ManagesEnvironments;
25+
use HandlesLogging, Macroable, ManagesEnvironments;
2626

2727
/**
2828
* @var string

src/Runtime.php

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,55 @@
44

55
abstract class Runtime
66
{
7+
public const NODEJS_20 = 'nodejs20.x';
8+
9+
public const NODEJS_18 = 'nodejs18.x';
10+
711
public const NODEJS_16 = 'nodejs16.x';
812

13+
/** @deprecated */
914
public const NODEJS_14 = 'nodejs14.x';
1015

11-
public const NODEJS_12 = 'nodejs12.x';
16+
public const PYTHON_312 = 'python3.12';
17+
18+
public const PYTHON_311 = 'python3.11';
19+
20+
public const PYTHON_310 = 'python3.10';
1221

1322
public const PYTHON_39 = 'python3.9';
1423

1524
public const PYTHON_38 = 'python3.8';
1625

26+
/** @deprecated */
1727
public const PYTHON_37 = 'python3.7';
1828

19-
public const RUBY_27 = 'ruby2.7';
29+
public const JAVA_21 = 'java21';
30+
31+
public const JAVA_17 = 'java17';
2032

2133
public const JAVA_11 = 'java11';
2234

2335
public const JAVA_8_LINUX2 = 'java8.al2';
2436

37+
/** @deprecated */
2538
public const JAVA_8 = 'java8';
2639

27-
public const GO_1X = 'go1.x';
40+
public const DOT_NET_7 = 'dotnet7';
2841

2942
public const DOT_NET_6 = 'dotnet6';
3043

31-
public const DOT_NET_31 = 'dotnetcore3.1';
44+
public const RUBY_32 = 'ruby3.2';
45+
46+
/** @deprecated */
47+
public const RUBY_27 = 'ruby2.7';
48+
49+
/** @deprecated */
50+
public const GO_1X = 'go1.x';
51+
52+
public const PROVIDED_AL2023 = 'provided.al2023';
3253

3354
public const PROVIDED_AL2 = 'provided.al2';
55+
56+
/** @deprecated */
57+
public const PROVIDED = 'provided';
3458
}

0 commit comments

Comments
 (0)