A layer
for AWS Lambda that allows your functions to use openssl
binaries.
You can add this layer to any Lambda function you want.
PATH
already includes /opt/bin
in Lambda, which is where it will be mounted.
Click on Layers and choose "Add a layer", and "Provide a layer version
ARN" and enter the following ARN (replace us-east-1
with the region of your Lambda):
arn:aws:lambda:us-east-1:034541671702:layer:openssl-lambda:1
Then click Add, save your lambda and test it out!
const { execSync } = require('child_process')
exports.handler = async(event) => {
execSync(' openssl genrsa -out testCert.key 2048', { encoding: 'utf8', stdio: 'inherit' })
}