Skip to content

ModifyCapacityReservation

Source: src/AWS/ELBv2/ModifyCapacityReservation.ts

Runtime binding for the ModifyCapacityReservation operation (IAM action elasticloadbalancing:ModifyCapacityReservation scoped to the load-balancer ARN).

Sets or resets the bound load balancer’s minimum LCU capacity reservation at runtime — e.g. a Lambda that pre-provisions capacity ahead of a known traffic spike (product launch, ticket sale) and resets it afterwards, the ELBv2 analogue of Auto Scaling’s SetDesiredCapacity. Provide the implementation with Effect.provide(AWS.ELBv2.ModifyCapacityReservationHttp).

// init — bind the operation to the load balancer
const modifyCapacityReservation =
yield* AWS.ELBv2.ModifyCapacityReservation(loadBalancer);
// runtime — reserve 100 LCUs per Availability Zone
yield* modifyCapacityReservation({
MinimumLoadBalancerCapacity: { CapacityUnits: 100 },
});
// later — release the reservation
yield* modifyCapacityReservation({ ResetCapacityReservation: true });