Skip to content

GetInvestigationGroupPolicy

Source: src/AWS/AIOps/GetInvestigationGroupPolicy.ts

Runtime binding for aiops:GetInvestigationGroupPolicy.

Reads the IAM resource policy attached to the bound InvestigationGroup (the policy that lets principals like aiops.alarms.cloudwatch.amazonaws.com create investigations), returned as a JSON string. Fails with the typed ResourceNotFoundException when no policy is attached. The group’s ARN is injected from the binding. Provide the implementation with Effect.provide(AWS.AIOps.GetInvestigationGroupPolicyHttp).

// init — grants aiops:GetInvestigationGroupPolicy on the group
const getInvestigationGroupPolicy =
yield* AWS.AIOps.GetInvestigationGroupPolicy(group);
// runtime — no policy attached surfaces as a typed error
const attached = yield* getInvestigationGroupPolicy().pipe(
Effect.map((r) => r.policy),
Effect.catchTag("ResourceNotFoundException", () =>
Effect.succeed(undefined),
),
);