Update or create a AWS lambda alias
$ npm install --save lambda-update-alias
const updateAlias = require('lambda-update-alias');
updateAlias('myLambdaFunction', 'v1'}).then(result => {
console.log(result);
/*
{
AliasArn: 'arn:aws:lambda:us-west-1:123456789012:function:myLambdaFunction:v1',
Name: 'v1',
FunctionVersion: '3',
Description: 'My lambda function description'
}
*/
});Returns a promise for the result object.
Type: string
Name of the lambda function.
Type: string
Name of the alias that should be attached to the lambda function.
Type: string
Default: latest
Name of the version where the alias should be attached to. If not provided, the alias will be attached to the version
with the highest number. $LATEST is treated as version 0.
Type: string
Can be overridden globally with the AWS_PROFILE environment variable.
Type: string
Filename to use when loading credentials.
Type: string
Default: us-west-1
AWS region.
The profile creating or updating the alias should be able to list the versions of the function and create and update the aliases.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1454507191000",
"Effect": "Allow",
"Action": [
"lambda:CreateAlias",
"lambda:ListVersionsByFunction",
"lambda:UpdateAlias"
],
"Resource": [
"*"
]
}
]
}- lambda-update-alias-cli - CLI for this module
MIT © Sam Verschueren