1import type * as cloudformation from "@distilled.cloud/aws/cloudformation";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Stack } from "./Stack.ts";
5
6/**
7 * Runtime binding for the `DescribeStackResources` operation (IAM action
8 * `cloudformation:DescribeStackResources`).
9 *
10 * Bind this operation to a {@link Stack} to resolve the physical ids of the
11 * stack's resources — e.g. look up a resource created by the template by its
12 * logical id from inside a function runtime. Provide the implementation with
13 * `Effect.provide(AWS.CloudFormation.DescribeStackResourcesHttp)`.
14 * ### Reading Stack Resources
15 * **Example:** Resolve a Resource's Physical Id
16 * ```typescript
17 * const describeStackResources =
18 * yield* AWS.CloudFormation.DescribeStackResources(stack);
19 *
20 * const { StackResources } = yield* describeStackResources({
21 * LogicalResourceId: "Param",
22 * });
23 * const physicalId = StackResources?.[0]?.PhysicalResourceId;
24 * ```
25 *
26 * @binding
27 */
28export interface DescribeStackResources extends Binding.Service<
29 DescribeStackResources,
30 "AWS.CloudFormation.DescribeStackResources",
31 (
32 stack: Stack,
33 ) => Effect.Effect<
34 (
35 request?: Omit<cloudformation.DescribeStackResourcesInput, "StackName">,
36 ) => Effect.Effect<
37 cloudformation.DescribeStackResourcesOutput,
38 cloudformation.DescribeStackResourcesError
39 >
40 >
41> {}
42export const DescribeStackResources = Binding.Service<DescribeStackResources>(
43 "AWS.CloudFormation.DescribeStackResources",
44);