Accelerator
Source:
src/AWS/GlobalAccelerator/Accelerator.ts
An AWS Global Accelerator standard accelerator — two anycast static IP addresses that route client traffic over the AWS global network to the closest healthy regional endpoint.
Accelerators are global resources (the control-plane API lives in
us-west-2 regardless of your deployment region — alchemy pins it
automatically). Attach Listeners to accept traffic and EndpointGroups
to route it to ALBs, NLBs, EC2 instances, or Elastic IPs per region.
Creating Accelerators
Section titled “Creating Accelerators”Basic Accelerator
import * as GlobalAccelerator from "alchemy/AWS/GlobalAccelerator";
const accelerator = yield* GlobalAccelerator.Accelerator("Edge");Dual-Stack Accelerator
const accelerator = yield* GlobalAccelerator.Accelerator("Edge", { ipAddressType: "DUAL_STACK",});Flow Logs
Section titled “Flow Logs”// the bucket policy must grant delivery.logs.amazonaws.com// s3:PutObject + s3:GetBucketAclconst accelerator = yield* GlobalAccelerator.Accelerator("Edge", { flowLogs: { bucket: logBucket.bucketName, prefix: "ga-flow-logs" },});Routing Traffic
Section titled “Routing Traffic”const accelerator = yield* GlobalAccelerator.Accelerator("Edge");const listener = yield* GlobalAccelerator.Listener("Web", { acceleratorArn: accelerator.acceleratorArn, portRanges: [{ fromPort: 443, toPort: 443 }], protocol: "TCP",});yield* GlobalAccelerator.EndpointGroup("UsWest2", { listenerArn: listener.listenerArn, endpointGroupRegion: "us-west-2", endpoints: [{ endpointId: alb.loadBalancerArn }],});