GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Sonic0/cdk-python-rust-lambda-tests: An example of Python CDK v2 Construct for AWS Lambda in Rust using Function-url feature. Local tests with SAM.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
cdk_lambda_rust
cdk_lambda_rust
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
app.py
app.py
 
 
cdk-build.sh
cdk-build.sh
 
 
cdk.json
cdk.json
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

A simple example with CDK V2 Python and Rust.

Install & Deploy

Install AWS CDK CLI

npm install -g aws-cdk

Install pip dependencies (I suggest the use of a virtual env)

pip install -U -r requirements.txt

Build code with

rustup target add x86_64-unknown-linux-musl (only the first time)
./cdk-build.sh

Deploy Lambda

cdk deploy LambdaRustTestStack [--profile <local-aws-profile>]

Test Lambda

The request and response event formats follow the same schema as the Amazon API Gateway payload format version 2.0. For more information about AWS Lambda Function-Url, see AWS Lambda doc.

Locally (SAM)

./cdk-build.sh
cdk synth --no-staging > template.yml
sam local invoke LambdaRustTestXXXXXXX --event tests/lambda-function-url-input-example.json

Function url via curl

Get function url from deploy Output

Input

curl -X POST -H "Content-Type: application/json" -d '{"message": "I love you, Nana", "name": "Hachiko" }' <function-url>

Output

{
  "response": "Hello, Hachiko! Your message is: I love you, Nana"
}

About

An example of Python CDK v2 Construct for AWS Lambda in Rust using Function-url feature. Local tests with SAM.

Topics

awsaws-lambdaaws-lambda-function-urlaws-lambda-rustaws-samcdk-constructscdk-examplecdkv2pythonrust-lang

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.