Deploy cloud services over multiple regions in a few simple steps
Multi-Region Deployment can deploy any service across multiple cloud regions in an automated fashion, saving significant time.
I am excited to present another time-saving CLI feature, which has just been added to CAIOS. CAIOS is an innovative, portable cloud operating system with unique ‘Infrastructure from Code’ technology that automatically translates developers’ code into cloud infrastructure. CAIOS breaks down barriers to faster, lower-cost development and deployment over the cloud.
Multi-region deployment lets you deploy your services to multiple regions without the hassle of going through the manual process of deployment through the AWS console or using the AWS CLI/SDK. With just a few simple CAIOS CLI commands, your service is out there!
The motivation behind the feature
In CAIOS, we put in efforts at making everything easy to use and accessible. When working across multiple regions, using only the AWS toolset took a lot of time and was a complex activity for the developers. This solution has been designed to simplify the whole process and hide the complexities from the developers.
This feature is utilizing AWS StackSets to perform its operations
Deploy CAIOS CloudFormation stack to selected regions
The CAIOS CloudFormation stack (also referred to as CAIOS stack below) operates as the base stack and a library of resources to be shared between service stacks.
Using a single command, you can clone and deploy CAIOS stack to multiple regions. To do so, run the following command from your CAIOS admin console:
caios install region-1 region-2 ...
This will create clones of your main CAIOS stack in every selected region.
These stacks will be managed by a CloudFormation StackSet. Here is an example of a CAIOS stack deployed with StackSets at AWS region ‘eu-west-2’.
Prepare and deploy your service
First of all, you have to ‘release’ your service artifacts to your local S3 bucket which is a part of your CAIOS stack. Navigate to the service directory and run the following command:
caios service release <my bucket name>
This will upload your service files to your admin bucket and will be used as a distribution source for every region you want to deploy to.
Note that for a successful service deployment, you must first install a CAIOS stack in the designated region.
Finally, to deploy your service, just type in the following command:
caios service launch <service name> region-1 region-2 ...
Made changes to your service? Simply, release and launch it again the same way.
In order to shut down the service, use the following command:
caios service shutdown <environment name> <my service name>
This method has proven to reduce packaging and deployment time drastically as it encapsulates many repetitive operations backstage.