The best way to control Claude Code, Codex and more from any computer or phone

main
ts 49 lines 1.66 KB
Raw
1 import type * as autoscaling from "@distilled.cloud/aws/auto-scaling";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { AutoScalingGroup } from "./AutoScalingGroup.ts";
5
6 /**
7 * `SetDesiredCapacity` request with `AutoScalingGroupName` injected from the
8 * bound {@link AutoScalingGroup}.
9 */
10 export interface SetDesiredCapacityRequest extends Omit<
11 autoscaling.SetDesiredCapacityType,
12 "AutoScalingGroupName"
13 > {}
14
15 /**
16 * Runtime binding for the `SetDesiredCapacity` operation (IAM action
17 * `autoscaling:SetDesiredCapacity` scoped to the group ARN).
18 *
19 * Manually sets the size of the bound Auto Scaling Group — e.g. a Lambda that
20 * scales a fleet up ahead of a known traffic spike or down to zero overnight.
21 * Provide the implementation with
22 * `Effect.provide(AWS.AutoScaling.SetDesiredCapacityHttp)`.
23 * ### Manual Scaling
24 * **Example:** Scale the fleet to a fixed size
25 * ```typescript
26 * // init — bind the operation to the group
27 * const setDesiredCapacity = yield* AWS.AutoScaling.SetDesiredCapacity(group);
28 *
29 * // runtime — set the fleet size, honoring the group's cooldown
30 * yield* setDesiredCapacity({ DesiredCapacity: 4, HonorCooldown: true });
31 * ```
32 *
33 * @binding
34 */
35 export interface SetDesiredCapacity extends Binding.Service<
36 SetDesiredCapacity,
37 "AWS.AutoScaling.SetDesiredCapacity",
38 (
39 group: AutoScalingGroup,
40 ) => Effect.Effect<
41 (
42 request: SetDesiredCapacityRequest,
43 ) => Effect.Effect<autoscaling.SetDesiredCapacityResponse, autoscaling.SetDesiredCapacityError>
44 >
45 > {}
46
47 export const SetDesiredCapacity = Binding.Service<SetDesiredCapacity>(
48 "AWS.AutoScaling.SetDesiredCapacity",
49 );