Deployment on AWS
This guide provides an overview on how to deploy your custom Add-on to AWS using ECS Fargate. ECS Fargate is a scalable and reliable solution to manage varying traffic levels for your Add-on.
Prerequisites
Before deploying your Add-on on AWS, you need to satisfy these prerequisites:
- Access to a SCAYLE instance
- Add-on API token
- AWS CLI installed
- Basic AWS stack
Foundation
A basic yet effective setup includes three components:
- Load balancer
All requests to the Add-on are intelligently routed through a load balancer, ensuring high availability and fault tolerance. In AWS this module is called Application Load Balancer or ALB. - Application container
Your Add-on needs to be deployed somewhere, so it can be delivered to the user. A quite easy serverless operational model that eliminates the need to manage servers or clusters is AWS ECS Fargate. - Secrets manager
Configurations, such as tokens or URLs should not be contained in your Add-ons codebase for security measures. The AWS Secrets Manager handles and stores these credentials securely and injects them automatically into your application.\
Basic AWS stack
- Set up an AWS Application Load Balancer (ALB)
Distribute incoming traffic across your services in a “round-robin” algorithm to enhance load handling and uptime.
For further information, please visit the AWS documentation\ - Host your services with AWS Fargate
Opt for AWS Fargate for hosting your services. This choice simplifies deployment as there's no need to manage servers. Simply deploy your docker image through a registry, like DockerHub or AWS Elastic Container Registry.
For further information, please visit the AWS documentation\ - Configure your services
Aim for at least two AWS Fargate tasks for redundancy (each in a different availability zone) to ensure continuous availability.
To handle requests efficiently, allocate sufficient CPU and memory to each task.
Auto Scaling is important so you don’t have to take manual action during a traffic peak. We recommend using CPU-based Auto Scaling with a target CPU set to 40% for production loads.\ - Manage configurations with AWS Secrets Manager
Store configurations, such as tokens or URLs in AWS Secrets Manager to keep them safe.
Deploy the AWS stack
aws cloudformation deploy
--stack-name ${STACK_NAME}
--capabilities CAPABILITY_NAMED_IAM
--template-file stack.yml
--parameter-overrides ScayleTenantSpace=${TENANT_SPACE} ScayleAddOnAPIToken=${SCAYLE_ADD_ON_API_TOKEN}
--no-fail-on-empty-changeset
Upon successful deployment, you can now follow our guide on how to configure your Add-on in the SCAYLE Panel.
\