the-ldk
Version:
Welcome to the LDK! A collection of custom AWS CDK constructs to help you build serverless applications faster.
27 lines • 1.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TSLambdaFunction = void 0;
const constructs_1 = require("constructs");
const aws_lambda_nodejs_1 = require("aws-cdk-lib/aws-lambda-nodejs");
const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
class TSLambdaFunction extends constructs_1.Construct {
constructor(scope, id, props) {
super(scope, id);
const { serviceName, stage, entryPath, handlerName = 'handler', tsConfigPath, functionName = `${serviceName}-${id}-${stage}`, customOptions = {}, } = props;
this.tsLambdaFunction = new aws_lambda_nodejs_1.NodejsFunction(this, `${serviceName}-${id}-${stage}`, {
entry: entryPath,
runtime: aws_lambda_1.Runtime.NODEJS_20_X,
architecture: aws_lambda_1.Architecture.ARM_64,
handler: handlerName,
bundling: {
sourceMap: true,
minify: true,
tsconfig: tsConfigPath,
},
functionName,
...customOptions,
});
}
}
exports.TSLambdaFunction = TSLambdaFunction;
//# sourceMappingURL=TSLambdaFunction.js.map