The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as ga from "@distilled.cloud/aws/global-accelerator"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { AddEndpoints } from "./AddEndpoints.ts"; |
| 4 | import { makeGaEndpointGroupHttpBinding } from "./BindingHttp.ts"; |
| 5 | |
| 6 | export const AddEndpointsHttp = Layer.effect( |
| 7 | AddEndpoints, |
| 8 | makeGaEndpointGroupHttpBinding({ |
| 9 | tag: "AWS.GlobalAccelerator.AddEndpoints", |
| 10 | operation: ga.addEndpoints, |
| 11 | // Global Accelerator authorizes AddEndpoints as an update to the |
| 12 | // endpoint group ("not authorized to perform: |
| 13 | // globalaccelerator:UpdateEndpointGroup" when only AddEndpoints is |
| 14 | // granted), so both actions are required. |
| 15 | actions: ["globalaccelerator:AddEndpoints", "globalaccelerator:UpdateEndpointGroup"], |
| 16 | // Global Accelerator validates new endpoints by describing them on the |
| 17 | // caller's behalf, so adding endpoints requires read access to the |
| 18 | // underlying EC2 / ELB resources (none support resource-level scoping). |
| 19 | // https://docs.aws.amazon.com/global-accelerator/latest/dg/security_iam_service-with-iam.html |
| 20 | extraStatements: [ |
| 21 | { |
| 22 | Effect: "Allow", |
| 23 | Action: [ |
| 24 | "ec2:DescribeAddresses", |
| 25 | "ec2:DescribeInstances", |
| 26 | "ec2:DescribeInternetGateways", |
| 27 | "ec2:DescribeSubnets", |
| 28 | "elasticloadbalancing:DescribeLoadBalancers", |
| 29 | ], |
| 30 | Resource: ["*"], |
| 31 | }, |
| 32 | ], |
| 33 | }), |
| 34 | ); |