Skip to content

Instantly share code, notes, and snippets.

@diego3g
Created September 5, 2024 17:26
Show Gist options
  • Save diego3g/905ccae3ad6225ca56ba134253b08322 to your computer and use it in GitHub Desktop.
Save diego3g/905ccae3ad6225ca56ba134253b08322 to your computer and use it in GitHub Desktop.
const layers = new sst.aws.Bucket('CodeconEncodingLayers')
const ffmpegLayer = new aws.s3.BucketObjectv2('FFmpeg', {
bucket: layers.name,
key: 'ffmpeg.zip',
source: new $util.asset.FileArchive('../../src/layers/ffmpeg.tar.gz'),
})
const lambdaLayer = new aws.lambda.LayerVersion('FFmpegLayer', {
s3Bucket: layers.name,
s3Key: ffmpegLayer.key,
layerName: 'ffmpeg_layer',
compatibleRuntimes: [aws.lambda.Runtime.NodeJS20dX],
})
new sst.aws.Function('SampleFunction', {
handler: 'src/functions/sample.handle',
transform: {
function: {
ephemeralStorage: {
size: 2048,
},
},
},
layers: lambdaLayer.arn.apply(arn => [arn]),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment