| 1 | import type * as profiles from "@distilled.cloud/aws/route53profiles"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Profile } from "./Profile.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link ListProfileResourceAssociations} — the bound profile's |
| 8 | * id is injected as `ProfileId`, so only the optional `ResourceType` filter |
| 9 | * and pagination knobs remain. |
| 10 | */ |
| 11 | export interface ListProfileResourceAssociationsRequest extends Omit< |
| 12 | profiles.ListProfileResourceAssociationsRequest, |
| 13 | "ProfileId" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Runtime binding for `route53profiles:ListProfileResourceAssociations` — |
| 18 | * enumerate the DNS resources attached to the bound {@link Profile} |
| 19 | * (private hosted zones, Resolver rules, DNS Firewall rule groups; each item |
| 20 | * carries the resource's ARN, type, properties, and `Status`), so an ops |
| 21 | * function can audit what DNS configuration a shared profile bundles. The |
| 22 | * profile's id is injected automatically. |
| 23 | * |
| 24 | * Provide `AWS.Route53Profiles.ListProfileResourceAssociationsHttp` on the |
| 25 | * hosting Lambda Function to satisfy the requirement. |
| 26 | * ### Listing Attached DNS Resources |
| 27 | * **Example:** Enumerate the DNS resources attached to a Profile |
| 28 | * ```typescript |
| 29 | * // init — grants route53profiles:ListProfileResourceAssociations |
| 30 | * const listProfileResourceAssociations = |
| 31 | * yield* AWS.Route53Profiles.ListProfileResourceAssociations(profile); |
| 32 | * |
| 33 | * // runtime |
| 34 | * const { ProfileResourceAssociations = [] } = |
| 35 | * yield* listProfileResourceAssociations(); |
| 36 | * for (const association of ProfileResourceAssociations) { |
| 37 | * yield* Effect.log(`${association.ResourceType}: ${association.ResourceArn}`); |
| 38 | * } |
| 39 | * ``` |
| 40 | * |
| 41 | * @binding |
| 42 | */ |
| 43 | export interface ListProfileResourceAssociations extends Binding.Service< |
| 44 | ListProfileResourceAssociations, |
| 45 | "AWS.Route53Profiles.ListProfileResourceAssociations", |
| 46 | ( |
| 47 | profile: Profile, |
| 48 | ) => Effect.Effect< |
| 49 | ( |
| 50 | request?: ListProfileResourceAssociationsRequest, |
| 51 | ) => Effect.Effect< |
| 52 | profiles.ListProfileResourceAssociationsResponse, |
| 53 | profiles.ListProfileResourceAssociationsError |
| 54 | > |
| 55 | > |
| 56 | > {} |
| 57 | |
| 58 | export const ListProfileResourceAssociations = |
| 59 | Binding.Service<ListProfileResourceAssociations>( |
| 60 | "AWS.Route53Profiles.ListProfileResourceAssociations", |
| 61 | ); |