@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 46 lines 1.6 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
5 /**
6 * Runtime binding for `resource-groups:SearchResources`.
7 *
8 * Runs an ad-hoc resource query (the same `TAG_FILTERS_1_0` /
9 * `CLOUDFORMATION_STACK_1_0` syntax a query-based group is defined with)
10 * and returns the matching resource ARNs — a group-less preview of what a
11 * query would capture. Account-level: the query is chosen per request, so
12 * the grant is on `*` (including the Tagging API / CloudFormation
13 * read-through permissions the search fans out to). Provide the
14 * implementation with `Effect.provide(AWS.ResourceGroups.SearchResourcesHttp)`.
15 * ### Searching Resources
16 * **Example:** Find Resources By Tag
17 * ```typescript
18 * // init
19 * const searchResources = yield* AWS.ResourceGroups.SearchResources();
20 *
21 * // runtime
22 * const { ResourceIdentifiers } = yield* searchResources({
23 * ResourceQuery: {
24 * Type: "TAG_FILTERS_1_0",
25 * Query: JSON.stringify({
26 * ResourceTypeFilters: ["AWS::AllSupported"],
27 * TagFilters: [{ Key: "env", Values: ["prod"] }],
28 * }),
29 * },
30 * });
31 * ```
32 *
33 * @binding
34 */
35 export interface SearchResources extends Binding.Service<
36 SearchResources,
37 "AWS.ResourceGroups.SearchResources",
38 () => Effect.Effect<
39 (
40 request: resourcegroups.SearchResourcesInput,
41 ) => Effect.Effect<resourcegroups.SearchResourcesOutput, resourcegroups.SearchResourcesError>
42 >
43 > {}
44 export const SearchResources = Binding.Service<SearchResources>(
45 "AWS.ResourceGroups.SearchResources",
46 );