Skip to content

Latest commit

 

History

History
59 lines (35 loc) · 3.97 KB

manage-multiple-deployments.md

File metadata and controls

59 lines (35 loc) · 3.97 KB

Manage multiple deployments

A single deployment of LetsGo consists of the following components:

LetsGo Architecture

You can maintain multiple deployments of this stack in the same or different regions of AWS, and the LetsGo CLI makes it easy to set up and manage them all. You can also use LetsGo CLI to manage LetsGo stacks across different AWS accounts.

There are two primary scenarios targeted with the support for multiple deployments:

  1. Separating your production/development workloads. You can choose to run prod and stage deployments, or even have a separate deployment for individual developers on your team.
  2. Providing your customers with dedicated deployments. You can run those deployments on your AWS account or on your customer's AWS account as long as you have access to it.

In either scenario, the LetsGo CLI provides a consistent and repeatable mechanism to manage the configuration and the lifecycle of the deployment.

Deployment isolation

Deployments of LetsGo are designed to be isolated from one another, even if they are running on the same AWS account:

  • No data is shared between deployments, and the IAM policies of each deployment only allow it access to its own data. This applies to DynamoDB tables, SQS queues, ECR images, and SSM Parameter Store.
  • No components are shared between deployments. Each deployment has its own AppRunner services, Lambda functions, SQS queues, DynamoDB tables, a namespace in the SSM Parameter Store, and IAM policies.
  • All components and data of a deployment reside in the AWS region where that deployment was created.

Deployments do share the account and region-level AWS quotas, which is something to keep in mind when running multiple LetsGo deployments on the same AWS account or alongside other artifacts.

Deployment cost

The cost to maintain an idle deployment varies by AWS region but is in the $20/month vicinity. The pricing model for the components used by LetsGo deployments is mostly pas-as-you-go (DynamoDB, Lambda, AppRunner, SQS), so the cost will increase as your deployment sees more traffic.

Managing multiple deployments on the same AWS account

Each LetsGo CLI command accepts two options: -r, --region, and -d, --deployment, which allow you to specify the AWS region and LetsGo deployment name this command applies to. The default deployment name is main (unless overridden by the LETSGO_DEPLOYMENT environment variable), and the default region is us-west-2 (unless overridden by the AWS_REGION environment variable).

For example, to deploy a new stack called stage in the default region, you would call:

yarn ops deploy -a all -d stage

To deploy a new stack for a new developer on your team in the us-east-1 region, you could call:

yarn ops deploy -a all -r us-east-1 -d dev-emma

Managing multiple deployments across AWS accounts

The LetsGo CLI does not provide first-class support for specifying AWS accounts. Instead, it relies on the default AWS account configured at the AWS SDK level, which is the same as the default AWS account you configure for use by the AWS CLI.

If you want to operate on several AWS accounts using a single LetsGo installation on your machine, define an AWS CLI named profile for each of the accounts using the AWS CLI configuration file, and then use the AWS_PROFILE environment variable to select the profile you want when running a LetsGo CLI command, e.g.:

AWS_PROFILE=customer17 yarn ops deploy -a all

Related topics

Manage configuration
LetsGo CLI