Scalable Servers API
Overview
Scalable Servers are Auto Scaling Groups (ASG) that automatically adjust the number of EC2 instances based on demand. This provides high availability and automatic scaling for your applications.Scalable Server Endpoints
Scalable servers use AWS Auto Scaling Groups to automatically manage EC2 instance capacity. GatewaysApp creates ASGs with launch templates, default security groups, and configurable capacity limits.Create Scalable Server
POST /api/:projectSlug/:environmentSlug/scalable-servers- Create a new Auto Scaling Group in AWS
- Launch template with specified instance type and AMI
- Default security group (reuses project/environment default security group if it exists)
- Configurable min/max/desired capacity
- Automatic instance health checks
- Support for multiple availability zones via subnets
minSizemust be at least 0maxSizemust be at least 1desiredCapacitymust be betweenminSizeandmaxSize(inclusive)
List Scalable Servers
GET /api/:projectSlug/:environmentSlug/scalable-servers- List all scalable servers for a project environment
Get Scalable Server Details
GET /api/:projectSlug/:environmentSlug/scalable-servers/:id- Get details of a specific scalable server
Sync Scalable Server
Note: Scalable server sync is now performed through the unified resources API. Use the unified sync endpoint instead of the type-specific endpoint. Unified Sync Endpoint:PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync
See Resources API — Sync Resource from Cloud Provider for details.
Example Request:
Update Scalable Server Capacity
PATCH /api/:projectSlug/:environmentSlug/scalable-servers/:id/capacity- Update scalable server capacity (minSize, maxSize, desiredCapacity)
minSizemust be at least 0 (if provided)maxSizemust be at least 1 (if provided)desiredCapacitymust be betweenminSizeandmaxSize(inclusive)
Delete Scalable Server
Scalable server deletion is performed only via the unified resources API:DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId
forceDelete=true — Force delete even if instances are still running (default: false).
Example:
Error Responses
Error: Invalid capacityNotes
- Auto Scaling: AWS automatically adjusts the number of instances based on your capacity settings. You can manually update capacity using the PATCH endpoint.
- Health Checks: Auto Scaling Groups perform health checks on instances. Unhealthy instances are automatically terminated and replaced.
- Launch Templates: Each Auto Scaling Group uses a launch template that defines the instance configuration (AMI, instance type, security groups, etc.).
- Multi-AZ Support: Auto Scaling Groups automatically distribute instances across multiple Availability Zones via subnets.
- Connections: Scalable servers can be connected to DNS resources and other resources similar to regular instances.
- Deletion: Deleting a scalable server will terminate all instances and delete all associated connections (DNS records, etc.) before deleting the ASG itself.