Giter Site home page Giter Site logo

cargo-lambda / cargo-lambda-cdk Goto Github PK

View Code? Open in Web Editor NEW
96.0 6.0 8.0 31.42 MB

CDK Construct to build Rust functions with Cargo Lambda

Home Page: https://www.cargo-lambda.info

License: MIT License

JavaScript 1.43% TypeScript 24.94% Go 73.63%
aws rust aws-cdk aws-lambda

cargo-lambda-cdk's Introduction

cargo-lambda

crates.io Build Status

cargo-lambda is a Cargo subcommand to help you work with AWS Lambda.

Get started by looking at the documentation.

License

This project is released under the MIT License.

cargo-lambda-cdk's People

Contributors

calavera avatar hffmnn avatar mawallace avatar mmalenic avatar nchitty avatar nicholaschiasson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cargo-lambda-cdk's Issues

[Suggestion]: Derive Architecture for Bundling from Function Architecture

It would be nice to derive the architecture used for bundling from the architecture the lambda runs on. I don't think there should be a use case where these 2 should be different.

Something like this in function.ts should work:

// props?.bundling?.architecture > props?.architecture > default: Architecture.X86_64
const architecture = props?.bundling?.architecture ?
props?.bundling?.architecture :
props?.architecture ?
props?.architecture : Architecture.X86_64;

const bundling: BundlingOptions = { ...props?.bundling, architecture };

With that, it is still possible to set different architectures.

What do you think?

Update README with usage instructions for different languages

The README only talks about TypeScript. It should include examples for all the supported languages.

When a package is published to a repository like Nuget, we should try to find a way to publish a description with the examples for the specific language.

DOC: Typeo in variable name

from README.md

To force bundling in a docker container even if Cargo Lambda is available in your environment, set the forceDockerBundling prop to true.

variable name is forcedDockerBundling

Allow passing disableOptimizations to RustFunction.

It seems like adding debug = true to [profile.release] in my workspace Cargo.toml does nothing when using this construct to deploy my Lambda function.

I believe it is because Cargo Lambda ignores profile settings unless the disable-optimizations flag is set [docs, code].

Would it be possible to allow passing an argument to disable optimizations in this CDK construct?

Allow more docker `BundlingOptions`

It would be useful to have more of the BundlingOptions available when configuring the RustFunction using docker bundling. Sometimes I've encountered filesystem issues or permission errors when compiling crates, and options like bundlingFileAccess? or user? would be nice to have as a way around these.

Would it useful to allow all BundingOptions to be configurable, e.g. via an extends cdk.BundlingOptions?

Support all publish targets

It would be nice to be able to use the constructs in CDK projects written in other languages.

Can we use jsii to package for other languages and publish to other registries?

Is this working?

Hello,

I tried to use cargo-lambda-cdk to build a lambda function with API Gateway in front of it. But i was not successful. The build and deployment worked, but you received the following error when executing the function. I am using local builds (no docker since those fail building) on macOS with an M1

Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]
Runtime.InvalidEntrypoint

When comparing the created lambda function with another function I have, I found the difference that the cargo-lambda-cdk creates a nested structure which leads to the error.

working structure
Bildschirmfoto 2023-03-09 um 22 35 30

cargo lambda structure
Bildschirmfoto 2023-03-09 um 22 35 42

Bundling environment clarity

I was messing around with deploying my project using the RustFunction construct. I think maybe the README could be more clear on the topic:

Is the bundling.environment separate the from the environment variables the lambda runs with? Based on the README I expected the lambda to run with the environment set from bundling but in reality, there was no extra environment set.

Actual:
rust_lambda_env

Expectation:
lambda_env

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.