LaunchTemplate
Source:
src/AWS/AutoScaling/LaunchTemplate.ts
A launch template that preserves the Host authoring model used by
AWS.EC2.Instance, but packages that host configuration for use with an
Auto Scaling Group.
Creating a Launch Template
Section titled “Creating a Launch Template”Basic Launch Template
import { LaunchTemplate } from "alchemy/AWS/AutoScaling";
const template = yield* LaunchTemplate("Template", { imageId: "ami-0abcdef1234567890", instanceType: "t3.micro",});Launch a fleet from the template
import { AutoScalingGroup } from "alchemy/AWS/AutoScaling";
const group = yield* AutoScalingGroup("Fleet", { launchTemplate: template, subnetIds: [subnet.subnetId], minSize: 1, maxSize: 3,});Hosting Processes
Section titled “Hosting Processes”const template = yield* Effect.gen(function* () { yield* Http.serve(HttpServerResponse.json({ ok: true }));
return { main: import.meta.url, imageId, instanceType: "t3.small", securityGroupIds: [securityGroup.groupId], port: 3000, };}).pipe( Effect.provide(AWS.EC2.HttpServer), AWS.AutoScaling.LaunchTemplate("ApiTemplate"),);