forked from codemonger-io/codemonger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduces a new CDK construct `LatestBoto3Layer` that provisions a Lambda layer containing the latest boto3. `lambda/latest-boto3/requirements.txt` lists the modules and versions to be packaged as a Lambda layer. The latest boto3 is necessary because the default boto3 on the Lambda runtime does not support Redshift Serverless. issue codemonger-io#30
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
boto3==1.24.75 | ||
botocore==1.27.75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as path from 'path'; | ||
|
||
import { aws_lambda as lambda } from 'aws-cdk-lib'; | ||
import { Construct } from 'constructs'; | ||
import { PythonLayerVersion } from '@aws-cdk/aws-lambda-python-alpha'; | ||
|
||
/** CDK construct that provisions a Lambda layer containing the latest boto3. */ | ||
export class LatestBoto3Layer extends Construct { | ||
/** Lambda layer containing the latest boto3. */ | ||
readonly layer: lambda.ILayerVersion; | ||
|
||
constructor(scope: Construct, id: string) { | ||
super(scope, id); | ||
|
||
this.layer = new PythonLayerVersion(this, 'LambdaLayer', { | ||
description: 'Lambda layer containing the latest boto3', | ||
entry: path.join('lambda', 'latest-boto3'), | ||
compatibleRuntimes: [ | ||
lambda.Runtime.PYTHON_3_8, | ||
lambda.Runtime.PYTHON_3_9, | ||
], | ||
compatibleArchitectures: [ | ||
lambda.Architecture.ARM_64, | ||
lambda.Architecture.X86_64, | ||
], | ||
}); | ||
} | ||
} |