Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdk-lambda-fleet

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk-lambda-fleet

Deploy multiple AWS Lambda functions as docker images using AWS Cloud Development Kit

  • 1.3.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AWS CDK: Lambda Fleet

MIT License MIT License

Deploy multiple AWS Lambda functions as container images to ECR with CDK.

Intention

Have a CloudFormation stack with multiple AWS Lambda functions in different langauges.

Usage

You can fork this repository and create a folder like src/lambda-node-example and store a Dockerfile there:

FROM amazon/aws-lambda-nodejs:12

ARG FUNCTION_DIR="/var/task"

RUN mkdir -p ${FUNCTION_DIR}

COPY package.json ${FUNCTION_DIR}

RUN npm install

COPY handler.js ${FUNCTION_DIR}

CMD [ "handler.run" ]

Using the AWS CDK, a docker image will be created and deployed to Amazon ECR for every folder in src/. After uploading the image, an AWS Lambda will be created or updated to use the latest image.

CDK Construct

When using the AWS CDK in TypeScript, you can use the published LambdaFleet construct:

$ > yarn install cdk-lambda-fleet
import * as path from "path";
import * as cdk from "@aws-cdk/core";

import { LambdaFleet } from "cdk-lambda-fleet";

export class FleetStack extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new LambdaFleet(this, "Fleet", {
      path: path.resolve(__dirname, "../src"),
    });
  }
}

Examples

Deployment

# Deploy all functions

$ > yarn deploy

Usage

Fleet.FleetLambdaNodeExampleArnXYZ = "arn:aws:lambda:eu-central-1:123:function:Fleet-FleetLambdaNodeExampleXYZ-XYZ"
Fleet.FleetLambdaPythonExampleArnXYZ = "arn:aws:lambda:eu-central-1:123:function:Fleet-FleetLambdaPythonExampleXYZ-XYZ"
Fleet.FleetLambdaTypescriptExampleArnXYZ = "arn:aws:lambda:eu-central-1:123:function:Fleet-FleetLambdaTypescriptExampleXYZ-XYZ"

Keywords

FAQs

Package last updated on 06 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc