[!Warning] The Layer Library package has an unstable API and should not be used in a production environment. It should be assumed that the API will undergo heavy changes in upcoming versions.
The Layer Library provides a set of Lambda Layers constructs that are used as part of Project Lakechain .
It currently supports the following layers :
-
Mediainfo
- Allows to package the MediaInfo library as a Lambda Layer. -
Powertools
- Allows to use the AWS Lambda Powertools for TypeScript and Python as an AWS Lambda Layer. -
Sharp
- Allows to package the Sharp library as a Lambda Layer.
Below is an example of how to use the MediaInfo
layer.
import { MediaInfoLayer } from '@project-lakechain/layers/mediainfo';
class MyStack extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
// X64 architecture.
const layer = MediaInfoLayer.x64(this, 'Layer');
// ARM64 architecture.
const layer = MediaInfoLayer.arm64(this, 'Layer');
}
}
Below is an example of hoe to use the AWS Powertools layer within a construct.
import { PowerToolsLayer } from '@project-lakechain/layers/powertools';
class MyStack extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
// Powertools for TypeScript
const layer = PowerToolsLayer.typescript().layer(this, 'Layer');
// Powertools for Lambda (x64).
const layer = PowerToolsLayer.python().x64(this, 'Layer');
// Powertools for Lambda (arm64).
const layer = PowerToolsLayer.python().arm64(this, 'Layer');
}
}
Below is an example of hoe to use the Sharp layer within a construct.
import { SharpLayer } from '@project-lakechain/layers/sharp';
class MyStack extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
// X64 architecture.
const layer = SharpLayer.arm64(this, 'Layer');
}
}