Skip to main content
IAM Policy Map

AWSXrayReadOnlyAccess

ReaderAWS managedActiveReviewedShow on mapCompare

Summary

AWS X-Ray read only managed policy. The X-Ray Developer Guide says it provides read permissions for using the X-Ray console, AWS CLI or AWS SDK to get trace data, trace maps, insights and X-Ray configuration from the X-Ray API.

Permissions imported from the AWS Managed Policy Reference Guide; other sections reviewed against the listed AWS sources.

Identity

ARN
arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess
Default version
v8
Created
Last edited
Services
xray

Control-plane actions (12)

By access level: 2 List, 10 Read.

Control-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
X-Ray12 of 322 List, 10 Read; 0 restricted, 0 conditionalxray:BatchGetTraceSummaryById, xray:GetDistinctTraceGraphs, xray:GetGroup, xray:GetGroups, xray:GetInsight, xray:GetInsightEvents, xray:GetInsightImpactGraph, xray:GetInsightSummaries, xray:GetSamplingRules, xray:GetSamplingStatisticSummaries, xray:ListResourcePolicies, xray:ListTagsForResource
X-Ray: 12 actions
  • xray:BatchGetTraceSummaryById (Read)
  • xray:GetDistinctTraceGraphs (Read)
  • xray:GetGroup (Read)
  • xray:GetGroups (Read)
  • xray:GetInsight (Read)
  • xray:GetInsightEvents (Read)
  • xray:GetInsightImpactGraph (Read)
  • xray:GetInsightSummaries (Read)
  • xray:GetSamplingRules (Read)
  • xray:GetSamplingStatisticSummaries (Read)
  • xray:ListResourcePolicies (List)
  • xray:ListTagsForResource (List)

Data-plane actions (6)

By access level: 1 List, 5 Read.

Data-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
X-Ray6 of 121 List, 5 Read; 0 restricted, 0 conditionalxray:BatchGetTraces, xray:GetSamplingTargets, xray:GetServiceGraph, xray:GetTimeSeriesServiceStatistics, xray:GetTraceGraph, xray:GetTraceSummaries
X-Ray: 6 actions
  • xray:BatchGetTraces (List)
  • xray:GetSamplingTargets (Read)
  • xray:GetServiceGraph (Read)
  • xray:GetTimeSeriesServiceStatistics (Read)
  • xray:GetTraceGraph (Read)
  • xray:GetTraceSummaries (Read)

Excluded and conditional actions

No patterns are excluded by NotAction or Deny statements.

Resource scope and attachment

Resource scope across granted actions: all-resources.

Can be attached: Yes, to users, groups and roles.

Why this tier

  • Grants only List and Read actions.

Guidance

Practical scope

One statement (AWSXrayReadOnlyAccess) allows 18 xray actions on Resource "*": GetSamplingRules, GetSamplingTargets, GetSamplingStatisticSummaries, BatchGetTraces, BatchGetTraceSummaryById, GetDistinctTraceGraphs, GetServiceGraph, GetTraceGraph, GetTraceSummaries, GetGroups, GetGroup, ListTagsForResource, ListResourcePolicies, GetTimeSeriesServiceStatistics, GetInsightSummaries, GetInsight, GetInsightEvents and GetInsightImpactGraph.

Use cases

  • Give users or roles read access to X-Ray traces, service maps, insights and configuration.

Best practices

  • AWS managed policies don't grant least privilege permissions. The IAM User Guide says to consider the security risk of granting principals more permissions than they need, and suggests using Access Analyzer to see which permissions principals use, then writing a custom policy or generating one with only the required permissions.

Security considerations

  • It has no write actions in the document, but it applies to all resources, and it includes BatchGetTraces and GetTraceSummaries, which the X-Ray guide ties to getting trace data.
  • You cannot change the permissions in an AWS managed policy. If AWS updates the policy, the update affects every user, group and role it is attached to.

Assignment guidance

You can attach this policy to your users, groups and roles. The reference page also links to guidance on creating a permission set using AWS managed policies in IAM Identity Center. It fits where read-only access to X-Ray is intended.

Same service

Same domain

Frequently asked questions

When should I attach AWSXrayReadOnlyAccess?
The reference page says you can attach AWSXrayReadOnlyAccess to your users, groups and roles, and describes it as: AWS X-Ray read only managed policy. Attach it where viewing X-Ray traces and insights is the intended scope.
What does AWSXrayReadOnlyAccess grant?
It allows 18 xray read actions on all resources, covering traces, trace summaries, service and trace graphs, insights, groups, sampling rules and targets, tags and resource policies.
What are the security risks of AWSXrayReadOnlyAccess?
It grants no write actions, but it applies to all resources and includes xray:BatchGetTraces and xray:GetTraceSummaries, which return trace data. AWS managed policies don't grant least privilege permissions, and you must consider the security risk of granting principals more permissions than they need. AWS updates to the policy affect every identity it is attached to.

Policy JSON

Download policy.json

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AWSXrayReadOnlyAccess",
      "Effect": "Allow",
      "Action": [
        "xray:GetSamplingRules",
        "xray:GetSamplingTargets",
        "xray:GetSamplingStatisticSummaries",
        "xray:BatchGetTraces",
        "xray:BatchGetTraceSummaryById",
        "xray:GetDistinctTraceGraphs",
        "xray:GetServiceGraph",
        "xray:GetTraceGraph",
        "xray:GetTraceSummaries",
        "xray:GetGroups",
        "xray:GetGroup",
        "xray:ListTagsForResource",
        "xray:ListResourcePolicies",
        "xray:GetTimeSeriesServiceStatistics",
        "xray:GetInsightSummaries",
        "xray:GetInsight",
        "xray:GetInsightEvents",
        "xray:GetInsightImpactGraph"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

Version history

Current version v8, edited by AWS on 2024-02-14. Version history is recorded from 2026-11-11. Earlier versions are in the IAM console under Policy versions.

Attach snippets

AWS CLI

aws iam attach-role-policy --role-name ROLE_NAME --policy-arn arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess

CloudFormation

Resources:
  ExampleRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: {}  # replace with your trust policy
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess

Terraform

resource "aws_iam_role_policy_attachment" "awsxrayreadonlyaccess" {
  role       = aws_iam_role.example.name
  policy_arn = "arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess"
}

CDK (TypeScript)

role.addManagedPolicy(
  iam.ManagedPolicy.fromAwsManagedPolicyName("AWSXrayReadOnlyAccess"),
);

Sources