InstanceRefresh
Source:
src/AWS/AutoScaling/InstanceRefresh.ts
Runtime binding for the instance refresh operations — StartInstanceRefresh,
CancelInstanceRefresh, RollbackInstanceRefresh (IAM actions scoped to
the group ARN) and DescribeInstanceRefreshes (granted on *; EC2 Auto
Scaling Describe* actions do not support resource-level permissions).
Lets a deploy pipeline Lambda roll the fleet onto a new launch template
version, watch progress, and cancel or roll back a bad deploy. Provide the
implementation with Effect.provide(AWS.AutoScaling.InstanceRefreshHttp).
Rolling Deployments
Section titled “Rolling Deployments”Roll the fleet and watch progress
// init — bind the operations to the groupconst refresh = yield* AWS.AutoScaling.InstanceRefresh(group);
// runtime — start a rolling replacement with auto-rollbackconst { InstanceRefreshId } = yield* refresh.start({ Preferences: { MinHealthyPercentage: 90, AutoRollback: true },});
// runtime — check on itconst page = yield* refresh.describe({ InstanceRefreshIds: [InstanceRefreshId!],});Cancel a bad deploy
yield* refresh.cancel().pipe( Effect.catchTag("ActiveInstanceRefreshNotFoundFault", () => Effect.void),);