Building and bundling Lambda dependencies
Pulumi program to demonstrate how to install dependencies and package up code for deployment to AWS Lambda functions
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-ts-multi-language-lambdacd pulumi-examples/aws-ts-multi-language-lambdaThis example shows how to install dependencies and build multiple Lambda functions in different languages and then deploy the results.
Deploying the Lambda functions#
To deploy the infrastructure, follow the steps below:
Prerequisites#
You don’t need to install any languages other than NodeJS because we’ll use Docker containers to build the code.
Steps#
- Clone this repo:
git clone https://github.com/pulumi/examples - Change directory to the correct folder:
cd examples/aws-ts-multi-language-lambda - Install all required packages:
pulumi install - Run
pulumi up
Once all the resources have deployed, you can run the lambdas and see the outputs.
Don’t forget to run pulumi destroy when you’re done to delete the resources.