For more information on lambda_params and opts see the API section.
Example Project
See the example/ directory of this repo for a full working example.
API
lambda(lambda_params,opts)
lambda_params
Parameters describing the Lambda function. This can either be...
A String
corresponding to the name of an existing Lambda function. In this case gulp-awslambda will only update the function's code.
An Object
that is mostly the same as you would pass to updateFunctionConfiguration(). The only required parameters are FunctionName and Role. All the other parameters have the following default values:
Handler = 'index.handler': This assumes a valid exports.handler in index.js at the root of your ZIP
Runtime = 'nodejs4.3': Also accepts 'nodejs' and 'nodejs6.10'
gulp-awslambda will perform an upsert, meaning the function will be created if it does not already exist, and updated (both code and configuration) otherwise.
For code, gulp-awslambda will default to passing the ZipFile property. However, you may alternatively pass e.g.:
Allows you to publish a new version when passing in a string for lambda_params. Otherwise, you may simply specify Publish as a parameter. If both are provided, the value in lambda_params will take precedence.
region = 'us-east-1'
Set your AWS region.
alias
Requires publish=true. Creates an alias for the version being published. If the alias already exists, it is updated to point to the version being published. Alternate versions may be specified. The following options are supported:
name
Required string. The name of the alias.
description
Optional text to describe the function's version alias.
version
Optional version number to which to assign the alias. If not specified, the alias will be assigned to the version just published.
请发表评论