DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Building Scalable Data Lake Using AWS
  • Building a Scalable ML Pipeline and API in AWS
  • Breaking AWS Lambda: Chaos Engineering for Serverless Devs
  • AWS Step Functions Local: Mocking Services, HTTP Endpoints Limitations

Trending

  • Beyond Code Coverage: A Risk-Driven Revolution in Software Testing With Machine Learning
  • Unmasking Entity-Based Data Masking: Best Practices 2025
  • Scaling DevOps With NGINX Caching: Reducing Latency and Backend Load
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Creating AWS Lambda Functions From Octopus Deployments

Creating AWS Lambda Functions From Octopus Deployments

Merging continuous deployment and serverless tech is possible. Assuming you've got a pivot machine, you can combine the power of your Octopus deploys and AWS Lambda.

By 
João Rosa user avatar
João Rosa
·
Jan. 12, 17 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
9.7K Views

Join the DZone community and get the full member experience.

Join For Free

AWS Lambda is one of the AWS Compute Services, alongside with Amazon EC2 or Amazon EC2 Container Service. In a nutshell, AWS Lambda is the serverless offering from AWS, allowing you to “run code without provisioning or managing servers.”

In the DevOps spirit, and using Octopus as a continuous deployment tool, I couldn’t find a step template to create an AWS Lambda function. If doesn’t exist, create it, and give it away!

Background

AWS Lambda supports a broad range of technologies, such as Java, Python, and Node.js. The new kid on the block was .NET Core, announced on Dec. 1, 2016. It was a good announcement for Microsoft tech shops, adding another tool in the toolbelt.

The tools used for this demo were:

  • Visual Studio 2015 Community Edition.
  • AWS Toolkit for Visual Studio.
  • AWS Tools for Windows Powershell.
  • Octopus Deploy Community Edition.

Visual Studio and AWS Lambda Function Project

Using one of the Visual Studio AWS Lambda templates for the demo, the project was created and committed here. In a nutshell, the AWS Lambda function receives an Amazon S3 event and returns the S3 object Content Type. Simple and straightforward.

Continuous Integration Server

You can use your preferred CI server. It will need to handle the following:

  1. Publish the AWS Lambda .NET project
    dotnet publish AWSLambdaDemo -c Release
  2. Zip the published AWS Lambda .NET project
  3. Create the NuGet package for Octopus 
    Octo.exe pack --id AWSLambdaDemo --version 1.0.0.0
  4. Upload the AWS Lambda NuGet package to Octopus Server 
    NuGet.exe push AWSLambdaDemo.nupkg -ApiKey myApiKey -Source https://myOctopusServer


These instructions are generic and, depending on your CI server technology, can be done in different ways. You can take them as generic steps and just adapt them to your needs.

Creating the AWS Lambda Function Step Template

The step template is simple and straightforward. The PowerShell script:

  1. Checks if the AWS Tools for Windows PowerShell is installed.
  2. Gets all the required parameters, such as the access keys, region, function name, among others.
  3. Validates the parameters.
  4. Executes the operation.
  5. Provides feedback to the user.

The step template has a prerequisite — it depends on the AWS Tools for Windows PowerShell. You need to download and install it on the machines where the step will run.

Octopus Project

To create the AWS Lambda function, we need to use a pivot machine. At the moment, it is not possible to publish it directly to AWS.

octopus2awslambda

We will use some out-of-the-box Octopus features to deploy the AWSLambdaDemo package to the pivot machine, and the new step template will publish the function to AWS.

The demo octopus project will look like this:

octopus-project


The first step just deploys the uploaded NuGet AWSLambdaDemo package to a custom location in the pivot machine (with the role "AWS Lambda Demo").

The second step creates the AWS Lambda from the deployed NuGet AWSLambdaDemo package from the custom location.

octopus-aws-step


After creating a release (potentially triggered by the CI server), the Octopus server can deploy it.

octopus-aws-deploy


And voilá! A new AWS Lambda function is deployed!

aws-lambda

Final Thoughts

The step template is under the Octopus Library OSS. You can fork and add new features to it, or open an issue in my fork. All suggestions are welcome.

AWS AWS Lambda Octopus (software)

Published at DZone with permission of João Rosa, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building Scalable Data Lake Using AWS
  • Building a Scalable ML Pipeline and API in AWS
  • Breaking AWS Lambda: Chaos Engineering for Serverless Devs
  • AWS Step Functions Local: Mocking Services, HTTP Endpoints Limitations

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!