Skip to content

ListTargetsForPolicy

Source: src/AWS/Organizations/ListTargetsForPolicy.ts

Runtime binding for organizations:ListTargetsForPolicy.

Lists all roots, organizational units, and accounts that the specified policy is attached to. Account-level operation — Organizations is a management-account-scoped global service, so the binding takes no resource argument. Provide the implementation with Effect.provide(AWS.Organizations.ListTargetsForPolicyHttp).

// init — account-level binding, no resource argument
const listTargetsForPolicy = yield* AWS.Organizations.ListTargetsForPolicy();
// runtime
const { Targets } = yield* listTargetsForPolicy({ PolicyId: policyId });