Skip to content

GetServiceLastAccessedDetails

Source: src/AWS/IAM/GetServiceLastAccessedDetails.ts

Runtime binding for iam:GetServiceLastAccessedDetails — poll and read the access-advisor report started by GenerateServiceLastAccessedDetails: job status plus, when COMPLETED, the per-service last-authenticated timeline for the entity.

The JobId is produced at runtime, so the binding takes no arguments and grants iam:GetServiceLastAccessedDetails on *. Provide the implementation with Effect.provide(AWS.IAM.GetServiceLastAccessedDetailsHttp).

// init
const getServiceLastAccessedDetails =
yield* IAM.GetServiceLastAccessedDetails();
// runtime
const report = yield* getServiceLastAccessedDetails({ JobId: jobId });
if (report.JobStatus === "COMPLETED") {
const unused = report.ServicesLastAccessed?.filter(
(s) => s.LastAuthenticated === undefined,
);
}