AWS Lambda
You can use Argonaut to deploy your application as a Lambda container image—deploy as a serverless application. You do not need to make any custom configuration in your application for this. Meaning your application will be able to scale up and down, as needed once deployed as a Lambda container using Argonaut.
This document guides you through setting up an automatic deployment for your application as Lambda container using Argonaut.
Argonaut currently supports the following Lambda runtimes:
- Node.js 14
- Node:latest
- Python 3.9
- Go 1.x
Prerequisites
- A GitHub/GitLab repository (public or private) that runs a Lambda runtime application.
- An Argonaut account.
- An organization set up within your Argonaut account.
- Your AWS account linked with Argonaut.
- Your GitHub repository linked with Argonaut.
- An environment set up on Argonaut.
1. Configure your application deployment
You need to configure an application
entity in Argonaut that directly maps to the application that you want to deploy.
To configure a new application
on Argonaut:
On your Argonaut dashboard, click on
Applications
on your left pane.Click the button
Deploy
on the top right.
- Select your
source
version control in theDeployment Setup
step.
This takes you to the
Deployment Details
step where you will configure the source code of your newapplication
entity.- Choose your GitHub/GitLab account from the dropdown.
- Choose the repository that has your Lambda application.
- Choose your branch.
- Click
Next
.
You’ll be taken to the
Select Runtime
step. Select theLambda
runtime.Choose your environment. This will be the region and the VPC your Lambda application will be hosted and run on. This region will be where AWS Lambda will dynamically provision resources for your application. You can choose from one of your existing environments or create a new environment by clicking on the
+
sign.Configure how your application needs to be built.
- Fill in the
App Name
. This will be your application’s identification on Argonaut. - Choose the
Build Method
- the Lambda runtime, for your application. - Fill in the
port
. This is the port on which your application will be hosted when deployed via Argonaut. - Fill the
Build Context
. If you have a monorepo structure, this would point to the folder containing the service. Else,.
or leave blank. - Fill the
Install Dependencies Command
. For example, in case of anode.js
application it will benpm I
. - Fill the
Build Command
depending on your runtime. - Fill the
Run Command
. For example, in case of anode.js
application, it will benpm start
. - Fill the
Run Command Directory
for your application.
- Fill in the
Click on
More
.Configure
Memory Size (MB)
.Memory Size (MB)
directly maps to theMemory (MB)
value setting in AWS Lambda. It is the amount of memory available to your Lambda application at runtime. You can increase or decrease the memory and CPU power allocated to your function using the Memory (MB) setting. Read more about this Lambda setting here.Configure
Timeout (s)
for your application.Fill
Custom Domain
: This is optional. It should be the Amazon Route53 domain entry that needs to be created for this app. When left blank, Argonaut creates a URL on its own for your application.Click
Deploy
.You'll be taken to the
Logs
page. Argonaut is now doing two things:- Triggering a deployment of your application to the specified URL and in the specified environment.
- Setting up your application to be automatically deployed on every code push.
2. Test your configured deployment
Let’s first verify the ongoing deployment. After clicking Deploy
, you’ll be taken to the deployment Logs
. To check if the deployment was complete, look for the Outputs
section in your logs. 1. Your left column should look like the above with Key
, Description
, Value
, etc. listed. 2. When the last line of your logs says success
, it means that your deployment is complete. 3. Navigate to your application’s URL. You should see the application running.
3. Test automatic deployment
To verify that your application gets deployed on every code push: 1. Make a change to your application’s source code repository, and push to remote. 2. Go to the Applications
page on the Argonaut dashboard. 3. Click on your application name. 4. Go to its Deployments
tab. 5. You should see a deployment running against your commit ID.
Under the hood
So you’ve set up your serverless AWS Lambda application to automatically be deployed whenever new code is pushed to its source code. But what does Argonaut do behind the scenes to make this work?
When you click Deploy
:
Argonaut containerizes your application—packages your Lambda code and its dependencies into a Lambda-compatible container image. That also means that you don’t have to containerize using Docker or others.
Argonaut pushes this container image to a new repository in Amazon ECR. Argonaut uses AWS ECR as the default container registry. It is configured to scan each image on push for vulnerabilities. You can view the details of the security scan from your aws console directly.
Argonaut then uses AWS SAM to automate the build and deployment of this container, i.e your Lambda application.