# parlel/autoscaling

A zero-dependency, in-process fake of **AWS Auto Scaling** (EC2 Auto Scaling
groups & launch configurations). Speaks the AWS Query (XML) wire protocol, so
the real `@aws-sdk/client-auto-scaling` works against it unchanged.

| | |
|---|---|
| **Port** | `4706` |
| **Protocol** | AWS Query / XML (API version `2011-01-01`, member-style lists) |
| **Health** | `GET /_parlel/health` |
| **Reset** | `POST /_parlel/reset` |

## Default connection

```
AWS_ENDPOINT_URL=http://127.0.0.1:4706
AWS_ACCESS_KEY_ID=parlel
AWS_SECRET_ACCESS_KEY=parlel
AWS_REGION=us-east-1
```

Any SigV4 credentials are accepted (auth is not verified).

## Supported operations

| Category | Operations |
|---|---|
| Auto Scaling groups | `CreateAutoScalingGroup`, `DescribeAutoScalingGroups`, `UpdateAutoScalingGroup`, `DeleteAutoScalingGroup`, `SetDesiredCapacity` |
| Launch configurations | `CreateLaunchConfiguration`, `DescribeLaunchConfigurations` |
| Launch templates | `CreateLaunchTemplate` (technically an EC2-API operation, included here for convenience) |

Setting/updating `DesiredCapacity` synthesizes or removes placeholder
instances (`i-…`) so describes reflect the requested capacity.

## SDK usage example

```js
import { AutoScalingClient, CreateAutoScalingGroupCommand, SetDesiredCapacityCommand } from "@aws-sdk/client-auto-scaling";

const asg = new AutoScalingClient({
  endpoint: "http://127.0.0.1:4706",
  region: "us-east-1",
  credentials: { accessKeyId: "parlel", secretAccessKey: "parlel" },
});

await asg.send(new CreateAutoScalingGroupCommand({
  AutoScalingGroupName: "web-asg",
  LaunchConfigurationName: "web-lc",
  MinSize: 1, MaxSize: 5, DesiredCapacity: 2,
  AvailabilityZones: ["us-east-1a"],
}));
await asg.send(new SetDesiredCapacityCommand({ AutoScalingGroupName: "web-asg", DesiredCapacity: 4 }));
```

## Access via MCP / preview URL

When running inside a Daytona sandbox, this HTTP service is exposed at an
automatically-provisioned preview URL. Point the SDK `endpoint` at that URL and
add the `x-daytona-preview-token` header on requests.

## Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

| Area | Limitation |
|---|---|
| Instances | Instances are synthetic placeholders; nothing is launched in the EC2 emulator. |
| Scaling policies | Target tracking / step scaling policies & CloudWatch alarms are not implemented. |
| Lifecycle hooks | Lifecycle hooks, warm pools, and instance refresh are not modeled. |
| Health checks | `HealthCheckType` is recorded but no health evaluation happens. |
| Launch templates | A minimal single-version template only; `CreateLaunchTemplateVersion` is not implemented. |
| Auth | SigV4 is accepted but never validated. |
| Persistence | In-memory; lost on restart/reset. |
