| 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 ListProfileAssociations} — the bound profile's id is |
| 8 | * injected as `ProfileId`, so only the optional VPC filter and pagination |
| 9 | * knobs remain. |
| 10 | */ |
| 11 | export interface ListProfileAssociationsRequest extends Omit< |
| 12 | profiles.ListProfileAssociationsRequest, |
| 13 | "ProfileId" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Runtime binding for `route53profiles:ListProfileAssociations` — enumerate |
| 18 | * the VPC associations of the bound {@link Profile} (each item carries the |
| 19 | * association id, VPC `ResourceId`, and its `Status`), so an ops function |
| 20 | * can audit which VPCs a shared DNS configuration currently applies to or |
| 21 | * wait for an association to reach `COMPLETE`. The profile's id is injected |
| 22 | * automatically. |
| 23 | * |
| 24 | * Provide `AWS.Route53Profiles.ListProfileAssociationsHttp` on the hosting |
| 25 | * Lambda Function to satisfy the requirement. |
| 26 | * ### Listing VPC Associations |
| 27 | * **Example:** Enumerate the VPCs a Profile applies to |
| 28 | * ```typescript |
| 29 | * // init — grants route53profiles:ListProfileAssociations |
| 30 | * const listProfileAssociations = |
| 31 | * yield* AWS.Route53Profiles.ListProfileAssociations(profile); |
| 32 | * |
| 33 | * // runtime |
| 34 | * const { ProfileAssociations = [] } = yield* listProfileAssociations(); |
| 35 | * for (const association of ProfileAssociations) { |
| 36 | * yield* Effect.log(`${association.ResourceId}: ${association.Status}`); |
| 37 | * } |
| 38 | * ``` |
| 39 | * |
| 40 | * @binding |
| 41 | */ |
| 42 | export interface ListProfileAssociations extends Binding.Service< |
| 43 | ListProfileAssociations, |
| 44 | "AWS.Route53Profiles.ListProfileAssociations", |
| 45 | ( |
| 46 | profile: Profile, |
| 47 | ) => Effect.Effect< |
| 48 | ( |
| 49 | request?: ListProfileAssociationsRequest, |
| 50 | ) => Effect.Effect< |
| 51 | profiles.ListProfileAssociationsResponse, |
| 52 | profiles.ListProfileAssociationsError |
| 53 | > |
| 54 | > |
| 55 | > {} |
| 56 | |
| 57 | export const ListProfileAssociations = Binding.Service<ListProfileAssociations>( |
| 58 | "AWS.Route53Profiles.ListProfileAssociations", |
| 59 | ); |