Skip to content

ResourcePolicy

Source: src/AWS/XRay/ResourcePolicy.ts

An X-Ray resource policy — an account-level, resource-based IAM policy that grants other Amazon Web Services services and accounts access to X-Ray, e.g. allowing SNS active tracing to send trace segments.

Resource policies are not taggable; ownership is keyed by the deterministic policy name.

import * as XRay from "alchemy/AWS/XRay";
const policy = yield* XRay.ResourcePolicy("SnsActiveTracing", {
policyDocument: JSON.stringify({
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: { Service: "sns.amazonaws.com" },
Action: ["xray:PutTraceSegments", "xray:GetSamplingRules"],
Resource: "*",
},
],
}),
});