AutoScalingGroup
An AutoScalingGroup manages a scalable fleet of virtual machines that automatically adjusts the instance count based on demand. On AWS this is an Auto Scaling Group, on GCP a Managed Instance Group. Hetzner and DigitalOcean do not have native auto-scaling group equivalents.
Config
Section titled “Config”| Property | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | Unique resource name |
id |
string |
no | Explicit ID (auto-generated UUID if omitted) |
provider |
string |
no | Provider label for multi-provider configs |
tags |
Record<string, string> |
no | Arbitrary key-value metadata |
minSize |
number |
yes | Minimum number of instances |
maxSize |
number |
yes | Maximum number of instances |
desiredSize |
number |
no | Desired instance count (defaults to minSize) |
instanceType |
InstanceType |
yes | Abstract size or provider-specific map |
image |
ImageType |
yes | Abstract image or provider-specific map |
network |
Vpc | string |
yes | Vpc for instances |
securityGroups |
(SecurityGroup | string)[] |
no | Security groups for instances |
sshPublicKey |
string |
no | Public key for SSH access |
userData |
string |
no | Cloud-init / startup script |
distributeAcrossAzs |
boolean |
no | Spread instances across AZs |
healthCheckType |
string |
no | Health check type ('EC2' or 'ELB' on AWS) |
healthCheckGracePeriod |
number |
no | Grace period in seconds before health checks start |
Example
Section titled “Example”import { Vpc, AutoScalingGroup } from '@kykucloud/types'
const myVpc = new Vpc({ name: 'my-vpc', cidr: '10.0.0.0/16', region: 'eu-central' })
const asg = new AutoScalingGroup({ name: 'web-asg', minSize: 2, maxSize: 10, desiredSize: 3, instanceType: 'medium', image: 'ubuntu-24.04', network: myVpc, healthCheckType: 'ELB', healthCheckGracePeriod: 60,})Provider Support
Section titled “Provider Support”| Provider | Supported | Backend |
|---|---|---|
| AWS | ✅ | Auto Scaling Group (with Launch Template) |
| GCP | ✅ | Managed Instance Group |
| Hetzner | ❌ | Not available |
| DigitalOcean | ❌ | Not available |
- AWS ASG uses a Launch Template. Health checks can be EC2 status checks or ELB health checks. The ASG integrates with Load Balancer target groups for traffic distribution.
- GCP MIG (Managed Instance Group) uses an Instance Template. Supports auto-healing, autoscaling, and rolling updates. Regional MIGs distribute across zones.
- Scaling policies (CPU-based, scheduled, or dynamic) are not yet abstracted in this resource type. Use provider-specific configuration for advanced autoscaling policies.