question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PR Champion
# @eladb

Description

  • NodeFunction, JavaFunction, PythonFunction, etc.
  • Automatic publishing of environment variables
  • Combine “grant” & publish (e.g. bucket.grantXxx(lambda) will also add BUCKET_ARN environment variable)

Progress

  • Tracking Issue Created
  • RFC PR Created
  • Core Team Member Assigned
  • Initial Approval / Final Comment Period
  • Ready For Implementation
    • implementation issue 1
  • Resolved

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jogoldcommented, Mar 7, 2020

Hey @eladb, I’m sure you’ve seen https://github.com/aws/aws-cdk/pull/6535… I’ve been working further on this to come up with the best possible developer experience for JS/TS Lambda functions.

I have now a working construct offering the following API:

image

Code can be defined inside the construct and it can use any top level dependency imported in the file (another file or an external module). This offers a really great developer experience. I’m using the Typescript Compiler API to analyze the AST for this.

It ~can also easily support~ supports props like externals (= a list of module that should not be bundled like aws-sdk) and natives (= a list of modules that should be included/installed in the node_modules folder, can be done in a Lambda compatible docker image). The whole process could be dockerized.

We can discuss this further when you’re available.

2reactions
eladbcommented, Mar 1, 2020

I tend to agree that synth is more inline with how we want CDK experience to work. Ideally we should offer some kind of an open framework for building assets inside docker images during synthesis.

The minimal surface can be something like "run this command inside a docker image with two mounted volumes: /src with the project source tree and /asset is mounted to where the asset output should be emitted (could be a directory or a file).

Then, we can implement our parcel bundler using something like this, and also perhaps implement an additional builder that leverages sam build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lambda deployment packages - AWS Documentation
Use a deployment package to deploy your Lambda function code. Lambda supports two types of deployment packages: container images and .zip file archives....
Read more >
ryfeus/lambda-packs: Precompiled packages for ... - GitHub
AWS Lambda pack in Python for processing satellite imagery. Basically it enables to deploy python code in an easy and cheap way for...
Read more >
AWS Lambda 101: Shave That Bundle Down
Smaller bundles will help you respect AWS quotas, allowing more functions in your AWS account! Resource, Quota. Lambda function deployment ...
Read more >
5 Ways To Bundle a Lambda Function Within an AWS ...
This post explains how to bundle or include a Lambda function within a CDK construct if your function requires external dependencies.
Read more >
How to bundle a nodejs lambda function? (using esbuild)
In this video we bundle a nodejs lambda function using lambda -build (powered by esbuild).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found