| 1 | import type * as iam from "@distilled.cloud/aws/iam"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `iam:GetServiceLastAccessedDetails` — poll and read the |
| 7 | * access-advisor report started by {@link GenerateServiceLastAccessedDetails}: |
| 8 | * job status plus, when `COMPLETED`, the per-service last-authenticated |
| 9 | * timeline for the entity. |
| 10 | * |
| 11 | * The `JobId` is produced at runtime, so the binding takes no arguments and |
| 12 | * grants `iam:GetServiceLastAccessedDetails` on `*`. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.IAM.GetServiceLastAccessedDetailsHttp)`. |
| 15 | * |
| 16 | * ### Access Advisor |
| 17 | * **Example:** Read a Completed Access Report |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const getServiceLastAccessedDetails = |
| 21 | * yield* IAM.GetServiceLastAccessedDetails(); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const report = yield* getServiceLastAccessedDetails({ JobId: jobId }); |
| 25 | * if (report.JobStatus === "COMPLETED") { |
| 26 | * const unused = report.ServicesLastAccessed?.filter( |
| 27 | * (s) => s.LastAuthenticated === undefined, |
| 28 | * ); |
| 29 | * } |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface GetServiceLastAccessedDetails extends Binding.Service< |
| 35 | GetServiceLastAccessedDetails, |
| 36 | "AWS.IAM.GetServiceLastAccessedDetails", |
| 37 | () => Effect.Effect< |
| 38 | ( |
| 39 | request: iam.GetServiceLastAccessedDetailsRequest, |
| 40 | ) => Effect.Effect< |
| 41 | iam.GetServiceLastAccessedDetailsResponse, |
| 42 | iam.GetServiceLastAccessedDetailsError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const GetServiceLastAccessedDetails = |
| 47 | Binding.Service<GetServiceLastAccessedDetails>( |
| 48 | "AWS.IAM.GetServiceLastAccessedDetails", |
| 49 | ); |