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

main
ts 49 lines 1.99 KB
Raw
1 import type * as resourcegroups from "@distilled.cloud/aws/resource-groups";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Group } from "./Group.ts";
5
6 /** Request for {@link GroupResources} — the group is injected from the binding. */
7 export type GroupResourcesRequest = Omit<resourcegroups.GroupResourcesInput, "Group">;
8
9 /**
10 * Runtime binding for `resource-groups:GroupResources`.
11 *
12 * Adds the specified resources to the bound {@link Group}. Supported only
13 * for groups configured with `AWS::ResourceGroups::ApplicationGroup`,
14 * `AWS::EC2::HostManagement`, or `AWS::EC2::CapacityReservationPool` —
15 * query-based groups derive membership from their query instead. Grouping
16 * is asynchronous (application-group members are tagged with
17 * `awsApplication`): the response reports `Pending` ARNs which
18 * {@link ListGroupingStatuses} tracks to `SUCCESS`/`FAILED`. The group name
19 * is injected from the binding; the grant includes the Tagging API
20 * permissions the membership tagging fans out to (member services may
21 * additionally require their own `TagResource` permission on the caller).
22 * Provide the implementation with
23 * `Effect.provide(AWS.ResourceGroups.GroupResourcesHttp)`.
24 * ### Managing Group Membership
25 * **Example:** Add A Resource To An Application Group
26 * ```typescript
27 * // init — bind the operation to the group
28 * const groupResources = yield* AWS.ResourceGroups.GroupResources(group);
29 *
30 * // runtime
31 * const { Succeeded, Pending, Failed } = yield* groupResources({
32 * ResourceArns: [resourceArn],
33 * });
34 * ```
35 *
36 * @binding
37 */
38 export interface GroupResources extends Binding.Service<
39 GroupResources,
40 "AWS.ResourceGroups.GroupResources",
41 (
42 group: Group,
43 ) => Effect.Effect<
44 (
45 request: GroupResourcesRequest,
46 ) => Effect.Effect<resourcegroups.GroupResourcesOutput, resourcegroups.GroupResourcesError>
47 >
48 > {}
49 export const GroupResources = Binding.Service<GroupResources>("AWS.ResourceGroups.GroupResources");