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
Starting June, 20 2026, Amazon Linux 2 has reached end of support life.
The Swift Lambda Runtime plugins now use Amazon Linux 2023 for cross
compiling code.
> [!WARNING]
> When you compile on Amazon Linux 2023, you must deploy on Amazon Linux
2023 too
**When using the console**
<img width="946" height="254" alt="image"
src="https://github.com/user-attachments/assets/6289a194-348c-4d90-be24-df7cdfb7e8c3"
/>
**When using the AWS CLI**
```sh
aws lambda create-function \
--function-name MySwiftFunction \
--runtime provided.al2023 \
--role "$role_arn" \ // replace with the IAM role ARN to pass to your function
--handler bootstrap \
--architectures arm64 \
--zip-file "fileb://MySwiftFunction.zip"
```
**When using SAM**
```yaml
Resources:
APIGatewayLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: APIGatewayLambda.zip
Timeout: 60
Handler: swift.bootstrap # ignored by the Swift runtime
Runtime: provided.al2023
MemorySize: 128
Architectures:
- arm64
```
**When using the AWS CDK**
```ts
const lambdaFunction = new lambda.Function(this, 'SwiftLambdaFunction', {
runtime: lambda.Runtime.PROVIDED_AL2023,
architecture: lambda.Architecture.ARM_64,
handler: 'bootstrap',
code: lambda.Code.fromAsset('APIGatewayLambda.zip'),
memorySize: 128,
timeout: cdk.Duration.seconds(30),
environment: {
LOG_LEVEL: 'debug',
},
});
```
0 commit comments