Skip to content
Cake build addon for AWS Lambda
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build/scripts
nuspec
src
test
.gitattributes
.gitignore
LICENSE
README.md
ReleaseNotes.md
appveyor.yml
build-skip-restore.bat
build-skip-test.bat
build.bat
build.cake
build.ps1
cake.config

README.md

Cake.AWS.Lambda

Cake Build addin for Amazon Lambda

Build status

cakebuild.net

Join the chat at https://gitter.im/cake-build/cake

Table of contents

  1. Implemented functionality
  2. Referencing
  3. Usage
  4. Example
  5. Plays well with
  6. License
  7. Share the love

Implemented functionality

  • Update lambda code
  • Publish lambda version
  • Create lambda alias
  • Update lambda alias
  • Uses AWS fallback credentials (app.config / web.config file, SDK store or credentials file, environment variables, instance profile)

Referencing

NuGet Version NuGet Downloads

Cake.AWS.Lambda is available as a nuget package from the package manager console:

Install-Package Cake.AWS.Lambda

or directly in your build script via a cake addin directive:

#addin "Cake.AWS.Lambda"

Usage

#addin "Cake.AWS.Lambda"

Task("Update-Function-Code")
    .Description("Updates the AWS Lambda functions code.")
    .Does(async () =>
{
    var settings = new UpdateFunctionCodeSettings()
    {
        RevisionBucket = "company-deployments",
        RevisionKey = "AwesomeFunction.zip"
    }.Initialize(Environment);

    var version = await UpdateFunctionCode("MyFunction", settings);
});

Task("Publish-Version")
    .Description("Publishes a version of your function")
    .Does(async () =>
{
    var settings = new PublishVersionSettings()
    {
        RevisionBucket = "company-deployments",
        RevisionKey = "AwesomeFunction.zip",
        Description = "v1.0"
    }.Initialize(Environment);

    var version = await PublishLambdaVersion("MyFunction", settings);
});

Task("Create-Alias")
    .Description("Update an alias that points to the specified Lambda function version.")
    .Does(async () =>
{
    var version = "12345";
    var settings = new PublishVersionSettings()
    {
        Name = "Production",
        Version = version,
        Description = "v1.0"
    }.Initialize(Environment);

    await CreateLambdaAlias("MyFunction", settings);
});

Task("Update-Alias")
    .Description("Update an alias that points to the specified Lambda function version.")
    .Does(async () =>
{
    var version = "12345";
    var settings = new UpdateVersionSettings()
    {
        Name = "Production",
        Version = version,
        Description = "v1.0"
    }.Initialize(Environment);

    await UpdateLambdaAlias("MyFunction", settings);
});

RunTarget("Update-Function-Code");

Example

A complete Cake example can be found here.

Plays well with

If your deploying applications to AWS its worth checking out Cake.AWS.S3, if your deploying websites to IIS its worth checking out Cake.IIS or if your deploying windows services check out Cake.Services.

If your looking for a way to trigger cake tasks based on windows events or at scheduled intervals then check out CakeBoss.

License

Copyright (c) 2015 - 2016 Phillip Sharpe

Cake.AWS.Lambda is provided as-is under the MIT license. For more information see LICENSE.

Share the love

If this project helps you in anyway then please ⭐️ the repository.

You can’t perform that action at this time.