Skip to main content

Deploying a Project to Multiple Environments

Overview

In this tutorial, we will deploy an Altostra project to several environments, each in a different AWS region.

We'll see how to:

  1. Create a basic project
  2. Create new Altostra Environments
  3. Push and tag a project version
  4. Deploy a project version to multiple Altostra Environments

Let's get started!

Things you'll need for this tutorial

  1. An Altostra Account (Don't have one yet? Just login here)
  2. Altostra extension for Visual Studio Code (VSCode Marketplace or see docs)
  3. A connected AWS cloud account ( Web Console settings or see docs)
  4. A GitHub account (Free. Don't have one yet? Just signup here)

We'll be using an Altostra template to create a simple CRUD service. If you want to learn more about the project, try our Create a Simple API Project tutorial.

Step 1: Create the sample project

In this step, we'll create the project we will be deploying.

In the Altostra Web Console:

  1. Go to Projects
  2. Click Create Project
  3. In the Name field we'll use My Altostra Project
  4. In the Template field, click the drop-down menu and select simple-crud-service-nodejs

This step will create the My Altostra Project project in your GitHub account, and populate it with the template project.

wc-create-project

You can now git clone the project to your local machine, and open it in VSCode.

git-clone-vscode

Step 2: Push the Project

Now that we have the project, we can push a new version:

alto push v1.0.0

push-version

A Version is the aggregation of your infrastructure and code before they've been adapted to a specific environment. A version can be deployed to any environment. You can read more about Altostra versions here.

Step 3: Creating the Environments

An Altostra Environment includes:

  • Name - The name of the Environment, eg: QA, Dev, Customer 1.
  • Location - The geographical region where your stacks will be deployed to.
  • Parameters - The environment variables specific for this environment (eg: DB connection strings, specific flags).
  • Other Altostra integrations - logging, monitoring, and orchestration.

You can read more about Altostra Environments here

When you connected your cloud account, we created a default Altostra Environment called "Production" for you. Now we'll create two more environments - Dev and QA - each in a different aws region.

Creating Dev Environment

In the Altostra Web Console:

  1. Go to Environments tab and click on Create Environment.
  2. In the name field, use "Dev"
  3. Select your AWS account and the us-east-2 (Ohio) region. (You can choose any region you want, but for the sake of the example we'll be using this one as Dev)
  4. Click Create to finish creating the environment.

Create Dev Environment

If this is the first you've created an Altostra Environment in that region, it'll take a few minutes for Altostra to initialize the region. You'll see a purple banner at the top of the screen while the environment is being initialized. Once the banner is gone, you'll be able to deploy seamlessly to that environment.

Creating QA Environment

Repeat the steps for the creation of the Dev env, and:

  1. In the Name field, enter QA
  2. Select your AWS account and the us-west-2 (Oregon) region. (You can choose any region you want, but for the sake of the example we'll be using this one as QA)
  3. Click Create to finish creating the environment.

Step 4: Deploying our project

Now that we have our project version (v1.0.0) and the relevant environments (Dev, QA and Production), we can deploy our project to these environments.

For more information about deploying projects, read the Deploy a Project guide.

Deploying a project creates a live release of your version in a specific environment. This live release is called a Stack.

Deploying a project version can be done from either the CLI or the Web Console.

Deploying to the Dev environment

On the project page:

  • Under Stacks, click New.
  • Use myDevStack for Stack Name.
  • We'll choose our latest Version, which is v1.0.0.
  • For Environment, we'll choose our Dev environment.
  • Click Deploy to deploy the new Dev stack.

deploy-to-dev

After we deployed to dev and checked everything, we can deploy to our QA environment.

On the project page:

  • Under Stacks, click New.
  • Use myQAStack for Stack Name.
  • We'll choose our only Version, which is v1.0.0.
  • For Environment, we'll choose our QA environment.
  • Click Deploy to deeply the new QA stack.

deploy-to-qa

Summary

We created a new project and deployed it to two different environments in two different geographical regions. We can now deploy new versions to each stack to update them, add more environments, and modify each environment by using Environment Parameters and integrations.

Ready to Get Started?

Get Started for Free
© 2022 Altostra, Inc.