The best way to control Claude Code, Codex and more from any computer or phone

main
ts 46 lines 1.61 KB
Raw
1 import type * as cloudcontrol from "@distilled.cloud/aws/cloudcontrol";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { CloudControlBindingOptions } from "./BindingOptions.ts";
5
6 /**
7 * Runtime binding for `cloudformation:ListResources`.
8 *
9 * Discovers resources of a given CloudFormation type in the account and
10 * Region — whether or not they were provisioned through Cloud Control.
11 * Because Cloud Control invokes the resource type's list handler with the
12 * caller's credentials, pass the handler's underlying permissions via
13 * {@link CloudControlBindingOptions.handlerPolicyStatements}.
14 * ### Reading Resources
15 * **Example:** List SSM Parameters
16 * ```typescript
17 * // init — account-level; grant the list handler's permissions too
18 * const listResources = yield* CloudControl.ListResources({
19 * handlerPolicyStatements: [
20 * { Effect: "Allow", Action: ["ssm:DescribeParameters"], Resource: ["*"] },
21 * ],
22 * });
23 *
24 * // runtime
25 * const page = yield* listResources({
26 * TypeName: "AWS::SSM::Parameter",
27 * MaxResults: 100,
28 * });
29 * const identifiers = (page.ResourceDescriptions ?? []).map((r) => r.Identifier);
30 * ```
31 *
32 * @binding
33 */
34 export interface ListResources extends Binding.Service<
35 ListResources,
36 "AWS.CloudControl.ListResources",
37 (
38 options?: CloudControlBindingOptions,
39 ) => Effect.Effect<
40 (
41 request: cloudcontrol.ListResourcesInput,
42 ) => Effect.Effect<cloudcontrol.ListResourcesOutput, cloudcontrol.ListResourcesError>
43 >
44 > {}
45
46 export const ListResources = Binding.Service<ListResources>("AWS.CloudControl.ListResources");