Skip to main content

Lambda

This walkthrough is aimed at first-time users of Argonaut. You will automate the deployment of an example application to AWS Lambda (serverless) runtime on the AWS cloud using Argonaut.

The pre-requisites for this deployment are:

  • A GitHub account
  • An AWS account (free or paid)

1. Create an account

If it’s your first time using Argonaut, you must sign up for an account. You will then receive an email with an account activation link. Alternatively, if you already have one, log into your account.

2. Create your workspace

Each Argonaut account needs to be associated with one Argonaut workspace. Create your workspace

  1. Type in a name for your Workspace. This CAN be changed later.
  2. Click Next

3. Connect your AWS account

You will be taken to the Connections page under Settings. Argonaut connects to AWS as an IAM user. Multiple connections to the same AWS account are not allowed.

Connect to your AWS account

  1. In the Connect Your Cloud section, select Account +
  2. Select Amazon Web Services and click Create AWS integration
  3. Log into your AWS account, if you aren’t already logged in.
  4. You’ll be redirected to the AWS CloudFormation's Create stack page.
  5. Note that the Create stack page is already populated with Argonaut-specific parameters.
  6. Click on the Create stack button.
  7. You should now see the new stack’s page on AWS CloudFormation dashboard.
  8. Navigate back to Connections page from your Settings.
  9. Scroll to Connect Your Cloud —> AWS.
  10. Click Refresh.
  11. You should see your newly connect AWS account ID.
  12. Against the AWS account ID, verify that the connection shows as Successful.

4. Connect your GitHub account

On the same screen, you will see a Version control option. Here, you can connect Argonaut to your GitHub or GitLab repository. For this demo, we use GitHub.

  1. In the Version Control section, click on Account +
  2. Choose GitHub, and click on the Connect button
  3. Click on the GitHub account you’d like to connect with Argonaut. You’ll host your sample application on this account.
  4. Click on Install to install ArgonautBot on your chosen GitHub account.
  5. Enter your password, and click on Confirm Password.
  6. On successfully connecting your GitHub account, you’ll be redirected to the Version Control page that shows your GitHub account.

5. Create an AWS environment

Argonaut automatically sets up environments easily in minutes

  1. Select the Environments Tab from the sidebar.
  2. Click on Environment +
  3. Choose Amazon Web Services.
  4. Give your environment a name env.
  5. Choose your environment’s region. An environment's region CAN’T be changed later.
  6. Click on Create.

Create your AWS environment

To check if the environment creation was successful, navigate to the environment page from the sidebar, and look for your environment's name in the list. Ready environments have a green check symbol indicating the operational status.

6. Set up automatic deployment

Fork the Examples repository into your GitHub account - the same account that you’ve connected to in Argonaut. The rest of the steps assume that the name of the forked repository is also Examples.

  1. Go to the environment tab, select env

  2. Under Lambda, select Application +, and choose the From Git option

  3. Select the env environment from the dropdown.

  4. Ensure your GitHub account is selected and the Examples repo and node-test branch is set.

  5. Fill your App Name as nodejsexample.

    1. Choose the Build Method as node:latest.
    2. Fill the port as 3000.
    3. Fill the Build Context as node-express.
    4. Fill the Install Dependencies Command as npm i.
    5. Fill the Run Command as npm start.

Lambda Build configs

  1. Click Deploy.
  2. After clicking Deploy, you’ll be taken to the deployment Logs. Your application is now being deployed.
  3. To check if the deployment was complete, look for the Outputssection in your logs. Deploy output logs
  4. Your left column should look like the above with Key, Description, Value, etc. listed.
  5. Now, go to the Applications page and look for your application nodejsexample.
  6. Scroll right, and click the PREVIEW URL against nodejsexample. This is the URL where your nodejsexample application is being hosted.
  7. You should see PING_PONG displayed on your screen.

You’ve successfully deployed your example application using Argonaut! Let’s test whether your application now automatically gets deployed when you push a code change.

7. Test automatic deployment

You’re now ready to test if your app gets deployed automatically whenever any code change is pushed to it. Let’s make a code change, and view the app again.

  1. Git clone your forked Examplesrepository on your local machine.
  2. Go to its node-express folder.
  3. Open the index.js file.
  4. Change the string PING_PONG in index.js to TEST_AUTO_DEPLOY.
  5. Push this change to your node-test branch.
  6. Check your application’s deployments on Argonaut dashboard: ApplicationsnodejsexampleDeployments
  7. You’ll see a deployment against your commit ID.
  8. Once the deployment is complete, navigate to your PREVIEW URL again.
  9. You’ll see TEST_AUTO_DEPLOY on your screen.

That’s it!

You just used Argonaut to successfully set up the automatic deployment of an example application on every code push. You can now connect your own app with Argonaut to automate its deployment.