Skip to main content
CloudWatch Metrics, CloudWatch Logs, CloudTrail and X-Ray data sources read from your AWS account. Free plan Rather than hand over access keys, you create a role in your account that SRE Agent assumes for a short time to read. Two pieces make that safe.
  • The role is a set of read-only permissions that lives in your AWS account. You create it, you control it, and you can delete it at any time. You do not paste any access keys for it.
  • The External ID is a value that must accompany every request to assume the role. Your role’s trust policy requires it, so a request that does not carry it is refused. It is the same for every AWS data source in your organization, so you set up the trust once and reuse the role. It is not a secret.
The form also shows Principal to trust, the identity that is allowed to assume your role. It is not a secret either: on its own it grants nothing, because every request must also carry your External ID.
1

Start the data source

Add a data source as described in Connect your data and choose an AWS type, for example CloudWatch Metrics. Pick your AWS Regions. Besides the regions every AWS account has on, the list offers the ones AWS keeps off until you enable them (see Regions your account turns on by hand). Set Authentication to AWS Assume Role.
2

Copy the trust values

The form shows a read-only External ID (one per organization) and, once shown, Principal to trust. You need both when you create the role. Enter the ARN of the role you are about to create in Role ARN, for example arn:aws:iam::<aws-account-id>:role/sre-agent-readonly, and select Save Data Source. Save now: SRE Agent does not check the role when you save, and the test fails until the role exists, so you run it in the last step.
3

Get the exact permissions

Go to Settings, then the Infrastructure tab. Under Required AWS permissions, select Show the policy. This panel is built from the data sources you have saved, which is why you saved first. The Read-only role block lists every permission your organization needs and which data source asked for it. Open Permissions policy (JSON) for the policy. When they are shown, a trust policy that already carries your External ID, a Terraform block and an AWS CLI block are available too. If you would rather build the role without saving first, the open-source Terraform modules linked on this tab and in the data source form create the role, its policy and the trust condition for you.
4

Create the role in AWS

In your AWS account, create the role with that permissions policy and trust policy, using the same name you entered in Role ARN.
5

Check and test

Back in Required AWS permissions, select Check the role has these to verify the role allows each action. Then go to Data Sources and select the signal button on the card, or Test Connection inside the edit form.
Keep the read-only role read-only. Remediation features use a separate connector and a separate role under Infrastructure, so an account that can be read is never writable through a data source.

What you see

A passing test shows Connection successful!. If the role is missing a permission, the failure names the denied action, and the form explains which permission to add. A trust policy that is missing the External ID condition is the most common reason a role works when you try it by hand but fails here. If queries return nothing although the permissions are right, check the regions selected on the data source first. For the other data source types, see Connect your data.

Regions your account turns on by hand

You can pick the regions AWS keeps off by default on an AWS data source or connector: Calgary (ca-west-1), Tel Aviv (il-central-1), the UAE (me-central-1), Bahrain (me-south-1), Cape Town (af-south-1), Zurich (eu-central-2), Milan (eu-south-1), Hong Kong (ap-east-1), Hyderabad (ap-south-2) and Jakarta (ap-southeast-3). For these regions, and for Mexico (mx-central-1), SRE Agent assumes your role through STS in us-east-1 and reads everything else in the region you chose, so the AssumeRole shows in your us-east-1 CloudTrail event history. Two things to check on your side:
  • Enable the region in your AWS account (Account, AWS Regions). Test Connection asks ec2:DescribeRegions in us-east-1 with your role whether the region is enabled, and says so when it is not. The read-only role of the Terraform module grants ec2:Describe*, and the policy Settings generates includes the action; a role without it still passes Test Connection, because the check is skipped.
  • If your role’s trust policy or an organization policy limits aws:RequestedRegion for sts:AssumeRole, allow us-east-1 too. When AssumeRole is refused for one of these regions, the message says SRE Agent asks through STS in us-east-1 and names the condition to look at.
A region SRE Agent does not know is refused when you save the data source or connector, and a source that already holds one reads nothing and says so; it is never read in another region. ap-southeast-4, ap-southeast-5, ap-southeast-6, ap-southeast-7, ap-east-2 and eu-south-2 are known but not read yet.

How SRE Agent calls AWS

Every AWS request SRE Agent makes for you goes through one gateway, except Amazon Managed Prometheus queries, which are signed and sent directly. A call is attempted up to 10 times, waiting a random, growing time (up to 10 seconds) between attempts, and stops early at the deadline of whoever is waiting: a page, a tool call or a chat question that names no deadline of its own stops retrying after 8 seconds. A throttle, a server error and a network fault are retried; a denial, a missing resource, a rejected request and a concurrency cap are reported at once. A write, such as ssm:SendCommand, an ECS or Auto Scaling change or a Lambda invoke, is retried only when AWS refused it before running it (a throttle, or a network fault before a connection existed), so an approved runbook step never runs twice because of a retry. A data source or connector that assumes a role asks sts:AssumeRole once and reuses the temporary credentials until 5 minutes before they expire, so sts:AssumeRole appears in your CloudTrail about once an hour per role rather than once per request. Editing, disabling or deleting it in SRE Agent drops the credentials at once. A change you make in AWS, such as removing SRE Agent from the role’s trust policy, takes effect when the credentials are next refreshed, at most about 55 minutes later; to stop a connector at once, disable it in SRE Agent or revoke the role’s active sessions in IAM. “Throttled” means AWS answered with a rate-limit error and the retries did not get an answer in time: your account’s API quota in that region was in use when SRE Agent asked, often by your own tooling or other monitoring. SRE Agent says so wherever it shows data: the Explorer’s coverage panel marks the account and region as throttled, investigation answers say “AWS throttled this read” and name every region they could not list, Capacity Planning and FinOps show a CloudWatch read they could not get as unread rather than as zero (and FinOps leaves the findings that need it as they were), and the IAM scan says when AWS throttled it.

How SRE Agent shares your account’s API quota

SRE Agent shares each AWS account’s API quota on purpose. A question you ask from a page, MCP or Slack goes first, an investigation next, and scheduled scans take what is left, so a scan never makes you wait. SRE Agent stays well under your account’s limits (half of AWS’s published rate for most services, and 1.5 of AWS’s 2 a second for CloudTrail lookups) and slows itself down when AWS says the account is busy, which keeps your own tools from being throttled because of it. The budget is kept for each account, Region and kind of call, so a busy account does not slow another one. Changes SRE Agent makes on your approval, such as a runbook step or a self-healing fix, never wait for the budget; only reads do. Once the budget is enforced, a read that cannot get its turn in time is held back instead of being sent. The page or answer says so (“SRE Agent held this read back … to stay inside the account’s AWS API quota, which other work is using right now. Nothing failed in the account; ask again in a minute.”). It is not AWS failing and it is not an account with nothing in it: nothing was read. A Capacity Planning or FinOps series that was held back is shown as unread, never as zero, an Explorer account and region is marked throttled with the note “held back”, and a scan that was held back says which areas it did not read, keeps its earlier findings and runs again at its next window. An investigation or a scheduled scan waits at most 20 seconds in total for its turns. A scheduled scan yields in small steps, so it finishes; it only takes longer. In your CloudTrail this shows as fewer and steadier calls from SRE Agent, with no bursts when several scans start together. The budget is being introduced in two steps. Today SRE Agent only measures: it records what each account’s reads would have waited for, and nothing is delayed or refused yet. SRE Agent’s operators switch enforcement on after reading those measurements, and this page describes what you see once it is on.

The IAM scan reads the whole account only when IAM changed

The daily IAM scan always reads every known user’s access keys, their last use and sign-ins, and the credential report, so stale and old keys, dormant users and missing MFA are never more than a day old. It reads an account’s whole IAM (every user, role and policy) when any of these holds: CloudTrail’s IAM events or the account’s IAM counters show a change, SRE Agent itself changed IAM (a narrowed policy or a deactivated key), you press Run scan now, no earlier complete read exists, or the last full read is 7 days old. On a day the whole account is not read, the IAM tab and get_iam_scan say so for that account: “IAM in this account was unchanged since 08:05 UTC on 29 October (CloudTrail showed no IAM change), so today’s scan read its access keys and sign-ins and kept the rest from that read. The whole account is read again by 08:05 UTC on 5 November or as soon as IAM changes.” Policy and trust findings, unused permissions and a role’s dormancy are as of that last full read. The Compliance control for vulnerability management and the Security Overview’s IAM area say so too. A user or role created since the last full read is not listed until the next one. The longest a change can stay unread, from the change to the scheduled scan that reads it: The counters do not move for an inline policy edit, a trust policy edit, a permissions boundary, tags, a new default version of a managed policy, or a detach paired with an attach, so when CloudTrail cannot be used those changes wait for the next full read. A day on which the whole account was not read is shown as not looked at since, never as looked at and still there: a fix to a policy is judged only by a scan that read the account in full. If an account’s single whole-account read is held back to stay inside the quota, the scan reads that account user by user and role by role instead, and the IAM tab says so; with no room for that either, the scan stops and says it was held back, and its earlier findings stay. Today every account is still read in full every day. Skipping an unchanged account is switched on later by SRE Agent’s operators, after the measurements are read, and until then the IAM tab shows no unchanged accounts.

Fewer calls to your account

Capacity Planning and FinOps read CloudWatch metrics in cloudwatch:GetMetricData batches of many series per call, so your CloudTrail shows a few GetMetricData calls where it used to show many GetMetricStatistics calls (200 Lambda functions take 13 calls instead of 1,400). A role created from this guide or the Terraform module already allows it; a role that does not falls back to one call per series. When your role allows iam:GetAccountAuthorizationDetails, the daily IAM scan reads your users, roles and customer managed policies in a few paged calls, with the IAM credential report for console, MFA and password use (AWS refreshes that report at most every four hours, so those three figures can be up to four hours old); access keys and last-accessed reports are still read per user. The action is optional: without it, or when an account’s answer is too large to read in one pass, the scan reads the account principal by principal as before, and Settings, the IAM tab and get_iam_scan say which read was used and why. A listing that was cut short never removes a principal or resolves a finding. The scheduled reads of every organization no longer start at the same minute: each organization gets its own minute inside each window (image scans 05:00 to 05:35 UTC, FinOps 06:00 to 06:30, the hourly inventory between 20 and 50 minutes past the hour, alarm polls in the first 100 seconds of every 2 minutes). Each organization’s IAM scan runs once a day at a time of its own, the same every day, anywhere in the 24 hours (UTC), and its posture scan 20 minutes later. The IAM tab on the Security page shows when the next one runs, and so does get_iam_scan (next_scheduled_at). Each scan makes the same calls into your account as before; what changed is that the scans of different organizations no longer compete for AWS’s request limits at the same moment. If a scheduled start is missed, the next hour’s run notices that the organization has had no scan in the last 23 hours and queues one, so a scan is late by about an hour and never skipped for a day; a scan you started yourself counts. Running a scan yourself starts one at once and pulls a waiting scheduled one forward to now.