Skip to main content

AWS

In this walk-through, you’re going to automate the deployment of an example application on the AWS cloud using Argonaut. It is aimed at first-time users of Argonaut.

The walk-through assumes that you have and can log into:

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

Let's begin.

1. Create an account

If it’s your first time using Argonaut, you’ll need to sign up for an account. Alternatively, if you already have one, log into your account.

2. Create an organization

Each Argonaut account needs to be associated with one Argonaut organization. To create an organization:

  1. Click on the Settings icon on your top right.
  2. Click on Cloud Connect.
  3. Under Organization Details, type in a name in the Organization Name field.
  4. Click on the Set button.
  5. You should see an Org is set successfully message.

Create your organization

3. Connect your AWS account

On the same Cloud Connect page:

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

Connect to your AWS account

4. Connect your GitHub account

With your AWS account successfully connected, you finally need to connect Argonaut to your GitHub repository.

  1. Click on the Settings icon ⚙ on the top right of the top nav.
  2. Click Version Control on the left pane.
  3. Scroll to GitHub.
  4. Click +.
  5. Click on the GitHub account you’d like to connect with Argonaut. You’ll host your sample application on this account.
  6. Click on Install to install ArgonautBot on your chosen GitHub account.
  7. Enter your password, and click on Confirm Password.
  8. On successfully connecting your GitHub account, you’ll be redirected to the Version Control page that shows your GitHub account.

Connect your GitHub account

5. Create an environment on AWS

  1. Click on Infrastructure in the top nav bar.
  2. Click on Environments +.
  3. Choose Amazon Web Services.
  4. Give your environment a name.
  5. Choose your environment’s region. An environment's region can't be changed later.
  6. Click on Create Environment.

Create environment

To check if the environment creation was successful, navigate to the Infrastructure page from the top nav bar pane, and look for your environment's name in the list.

6. Create your EKS cluster

To deploy your application on K8s, you need to first create a K8s cluster:

Skip this step if you are choosing Lambda as your runtime.

  1. Navigate to Infrastructure → Select your Active AWS Environment → New Resource +.
  2. Click on EKS.
  3. Input the following values:
    1. Cluster Name as dev.
    2. Visibility spot.
    3. Instance Type t3.medium.
    4. Desired Node Count as 3.
    5. Set Nodes: Min as 3 and Max as 5.
    6. Set Disk Size as 50.
  4. Click on Create EKS.

7. Set up automatic deployment on an example application

  1. 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.
  2. On your Argonaut dashboard, click on Applications on your left pane.
  3. Click the button Deploy on the top right.
  4. Select Git Source in the Deployment Setup step.
  5. This takes you to the Deployment Details step.
    1. Choose your GitHub account from the dropdown.
    2. Choose the Examplesrepository.
    3. Choose the node-test branch.
    4. Click Next.
  6. You will be taken to the New Deployment screen. Check if the environment is the desired environment and region.
  7. Choose between Kubernetes and Lambda runtimes.
    1. Select the Kubernetes runtime
      1. Choose your target cluster as dev
      2. In Service, fill awsquickstart.
      3. In Path, fill ./Dockerfile.
      4. Ensure, Service Type is chosen as Stateless.
      5. Under Network Services, click Add Service.
        1. Fill in your Hostname.
        2. Fill in the port on which you want the application to run in Container Port.
      6. Ensure that Resource Requests & Limits have values set by default.
      7. Click Deploy.
    2. Select the Lambda runtime.
      1. Select your test environment from the dropdown.
      2. Fill your App Name as nodejsexample.
      3. Choose the Build Method as node:latest.
      4. Fill the port as 3000.
      5. Fill the Build Context as node-express.
      6. Fill the Install Dependencies Command as npm i.
      7. Fill the Run Command as npm start.
      8. Click Deploy. Configure application runtime details
  8. After clicking Deploy, you’ll be taken to the deployment Logs. Your application is now being deployed.
  9. To check if the deployment was complete, look for the Outputssection in your logs. Deploy output logs
  10. Your left column should look like the above with Key, Description, Value, etc. listed.
  11. Now, go to the Applications page and look for your application nodejsexample.
  12. Scroll right, and click the PREVIEW URL against nodejsexample. This is the URL where your nodejsexample application is being hosted.
  13. 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.

8. Test automatic deployment of your application

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.