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.

Lambda "build" assets

See original GitHub issue

We would like to leverage the aws-lambda-builders project (part of SAM CLI) in order to allow CDK users to build AWS Lambda bundles.

Requirement (API sketch):

new lambda.Function(this, 'MyFunction', {
  code: lambda.Code.build('/path/to/lambda/handler'),
  runtime: lambda.Runtime.Xxx,
  handler: 'foo.bar'
});

Ideally, this is all the user should need to specify. The lambda.Code.build class should be able to deduce most of the information needed in order to tell the toolkit to invoke aws-lambda-builders via it’s JSON RPC protocol when assets are prepared (similar to any other asset).

Notes:

  • Installation experience: it might okay if users would have to manually install aws-lambda-builders through pip install. We should consider if the toolkit can do this automatically upon first use?
  • SAM CLI uses heuristics to determine various options. The CDK should be able to use similar heuristics.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:29
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
eladbcommented, Oct 2, 2019

I think at a minimum we should provide guidance on how to use the SAM build capabilities as a pre synthesis step in order to produce lambda bundle zip files that can later be referenced as file assets for Lambda code.

7reactions
zoonmancommented, Aug 29, 2019

Hey guys, is there any progress on the issue for typescript version?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assets - AWS Cloud Development Kit (AWS CDK) v2
You add assets through APIs that are exposed by specific AWS constructs. For example, when you define a lambda.Function construct, the code property...
Read more >
Building, bundling, and deploying applications with the AWS ...
As of this writing, this works for two main types of assets: Docker ... In the context of the AWS CDK, when we...
Read more >
Assets - CDK for Terraform
Asset constructs manage assets for resources that need them, such as template_file, S3 bucket objects, or Lambda function archive files.
Read more >
Assets and Archives
The Pulumi SDK provides two classes for working with files: Asset and Archive. ... files) can be combined as part of building up...
Read more >
AWS CDK - Fullstack Polyglot with Asset Bundling
We have a common interface used for building Lambda functions, miscellaneous assets, S3 websites, Docker images and anything else you may ...
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