This is a CDK project that deploys a Rust function using the Rust runtime for Lambda. This creates a basic handler that logs some data sent as input.
Update: I have updated the Lambda function to use the newly introduced Graviton Processor for faster and cheaper workloads.
- Follow instructions mentioned in this post that explains how to build Rust functions for AWS Lambda.
Note: As we are using arm
as the architecture, we need to add the following target:
rustup target add aarch64-unknown-linux-musl
And then follow the instructions as specified in this post for cross-compilation.
- Create a
cdk.context.json
with theregion
key to specify the region of your choice (default isus-east-2
).
{
"region": "us-east-1"
}
The cdk.json
file tells the CDK Toolkit how to execute your app.
yarn build
compile typescript to jsyarn watch
watch for changes and compileyarn test
perform the jest unit testsyarn deploy
deploy this stack to your default AWS account/regionyarn cdk diff
compare deployed stack with current stateyarn cdk synth
emits the synthesized CloudFormation template