CDK Constructs for AWS Lambda in Node.js
Project description
Amazon Lambda Node.js Library
---This is a developer preview (public beta) module. Releases might lack important features and might have future breaking changes.
This API is still under active development and subject to non-backward compatible changes or removal in any future version. Use of the API is not recommended in production environments. Experimental APIs are not subject to the Semantic Versioning model.
This library provides constructs for Node.js Lambda functions.
Node.js Function
Define a NodejsFunction
:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
lambda.NodejsFunction(self, "my-handler")
By default, the construct will use the name of the defining file and the construct's id to look up the entry file:
.
├── stack.ts # defines a 'NodejsFunction' with 'my-handler' as id
├── stack.my-handler.ts # exports a function named 'handler'
This file is used as "entry" for Parcel. This means that your code is automatically transpiled and bundled whether it's written in JavaScript or TypeScript.
Alternatively, an entry file and handler can be specified:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
lambda.NodejsFunction(self, "MyFunction",
entry="/path/to/my/file.ts",
handler="myExportedFunc"
)
All other properties of lambda.Function
are supported, see also the AWS Lambda construct library.
Configuring Parcel
The NodejsFunction
construct exposes some Parcel options via properties: minify
, sourceMaps
,
buildDir
and cacheDir
.
Parcel transpiles your code (every internal module) with @babel/preset-env and uses the runtime version of your Lambda function as target.
Configuring Babel with Parcel is possible via a .babelrc
or a babel
config in package.json
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aws-cdk.aws-lambda-nodejs-1.24.0.tar.gz
.
File metadata
- Download URL: aws-cdk.aws-lambda-nodejs-1.24.0.tar.gz
- Upload date:
- Size: 14.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bdf53dab53b0d514623298096cd8cf1bc8d505b242c768eeab20341576c7ed6 |
|
MD5 | 6bb34dfa56e50014d6fe519f070785a4 |
|
BLAKE2b-256 | d3f4f4094f01057ea49bfec386a2ac885eccff3043fc36609ebaa575fa6da7c6 |
File details
Details for the file aws_cdk.aws_lambda_nodejs-1.24.0-py3-none-any.whl
.
File metadata
- Download URL: aws_cdk.aws_lambda_nodejs-1.24.0-py3-none-any.whl
- Upload date:
- Size: 14.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2d911b2c9a2db8ad17e500dd40e051e73c5f71620737f9f87339e441d4f943 |
|
MD5 | 2408ed6da5cab87dc0f7942a8c3e2423 |
|
BLAKE2b-256 | 566e7453d67d2a24ee2c286a3167247dbdf88330154f9684bec86a105f8135f0 |