imagemagick-aws-lambda-2
imagemagick-aws-lambda-2 copied to clipboard
update example to include AWS-CDK usage
hi,
Im not sure where this could go within the existing documentation, so I thought I could just quickly dump it into an issue (feel free to close it)
I had some trouble getting imagemagick-aws-lambda-2 to work with AWS-CDK the other night, so I thought I would share how I got it to work
const imageMagick = new CfnApplication(scope, 'imageMagick', {
location: {
applicationId: 'arn:aws:serverlessrepo:us-east-1:145266761615:applications/image-magick-lambda-layer',
semanticVersion: '1.0.0'
}
})
const lambdaFn = new lambda.Function(this, 'myLambda', {
...
layers: [
lambda.LayerVersion.fromLayerVersionArn(this, 'imageLayer', imageMagick.getAtt('Outputs.LayerVersion').toString())
]
})
:+1: definitely worth adding this to the README.md
- thanks for sharing @nexus-uw!