Skip to content

Example usage of AWS Lambdas with C++ using aws-lambda-cpp

License

Notifications You must be signed in to change notification settings

krk/hello-aws-lambda-cpp

Repository files navigation

Hello aws-lambda-cpp!

Uses aws-lambda-cpp library to handle a request to an AWS Lambda.

Usage

  1. Build lambda package as hello.zip.
  2. Give necessary permissions.
  3. Create lambda.
  4. Invoke lambda.

Build

make build-in-docker

Give Permissions

aws iam create-role \
  --role-name lambda-cpp-demo \
  --assume-role-policy-document file://trust-policy.json

aws iam attach-role-policy --role-name lambda-cpp-demo --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole

Create Lambda

aws lambda create-function \
  --function-name hello-world \
  --role arn:aws:iam::$AWS_ACCOUNT_ID:role/lambda-cpp-demo \
  --runtime provided \
  --timeout 15 \
  --memory-size 128 \
  --handler hello \
  --zip-file fileb://from_docker/hello.zip

Invoke Lambda

aws lambda invoke --function-name hello-world --payload '{ }' output.txt

About

Example usage of AWS Lambdas with C++ using aws-lambda-cpp

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published