AWS Lambda Deployment Overview
This topic provides an overview of deploying functions to AWS Lambda using Harness.
In this topic:
Setting up a Lambda deployment is as simple as adding your function zip file, configuring function compute settings, and adding aliases and tags. Harness takes care of the rest of the deployment, making it consistent, reusable, and safe with automatic rollback.
Basically, the Harness setup for Lambda is akin to using the AWS CLI aws lambda create-function, update-function-code, and update-function-configuration commands, as well as the many other commands that are needed.
The benefit with Harness is that you can set up your Lambda deployment once, with no scripting, and then have your Lambda functions deployed automatically as they are updated in your AWS S3 bucket. You can even templatize the deployment Environment and Workflow for use by other devops and developers in your team.
Furthermore, Harness manages Lambda function versioning to perform rollback when needed.
The following list describes the major steps we will cover in this guide:
- Delegate - Install the Harness Shell Script or ECS Delegate in your AWS VPC.
- AWS Cloud Provider - Add the AWS Cloud Provider. This is a connection to your AWS account. The AWS Cloud Provider can use your user account or the IAM role assigned to the Delegate host.
The AWS Cloud Provider is used to connect Harness to your Lambda deployment environment and to Amazon S3 to obtain your Lambda code files.
- Harness Application - Create the Harness Application for your Lambda CD pipeline. The Harness Application represents your Lambda code and functional spec, their deployment pipelines, and all the building blocks for those pipelines. Harness represents your Lambda deployment using a logical group of one or more entities: Services, Environments, Workflows, Pipelines, Triggers, and Infrastructure Provisioners. Applications organize all of the entities and configurations in Harness CD.
- Harness Service - Create the Harness Service using the Lambda type.
- Set up your Lambda code artifact source, Lambda Function Specification, and any config variables and files.
- Harness Environment - Create the Harness Environment containing the Service Infrastructure definition of your AWS deployment environment, and any overrides of Service settings.
- Harness Workflow - Create the Basic deployment Harness Workflow. This Workflow will deploy the Service (your Lambda code) to the Environment (your AWS Lambda functions for the region).
You can also add your Lambda Aliases and Tags as part of the Workflow.
- Deploy the Workflow.
- Advanced options not covered in this guide:
- Harness Pipeline - Create a Harness Pipeline for your deployment, including Workflows and Approval steps. Typically, Harness customers will deploy Lambda Pipelines with a Workflow for Dev, QA, Stage, etc:This example doesn't show Approval steps between Pipeline stages, which are also common. For more information, see our Pipelines and Approvals topics.
- Harness Trigger - Create a Harness Trigger to automatically deploy your Workflows or Pipeline according to your criteria. Typically, customers use a Trigger to execute a Lambda Pipeline using the Trigger's On New Artifact condition. Each time the Lambda artifact, such as a zip file, is updated in the artifact repository (AWS S3), the Pipeline is executed and the new Lambda function is deployed.
For more information, see Triggers.
- Harness Infrastructure Provisioners - Create Harness Infrastructure Provisioners, such as CloudFormation and Terraform, for your deployment environments. For more information, see Infrastructure Provisioners.
- Continuous Verification:
- Deployment Verification - Once you have successfully deployed you can add your APM and logging apps as Verification Providers, and then add Verify Steps to your Workflows. Harness will use its machine-learning to find anomalies in your deployments. For more information, see Continuous Verification.
- 24/7 Service Guard - Monitor your live applications, catching problems that surface minutes or hours following deployment. For more information, see 24/7 Service Guard.
Before You Begin
The following are required:
- AWS account - An AWS account you can connect to Harness.
- Harness Delegate - A Harness Shell Script or ECS Delegate installed in your AWS VPC that can connect to your S3 bucket and Lambda.
We will walk you through the process of setting up Harness with a connection to AWS, and will also summarize Harness Delegate installation.