IAM Policy Lint
Open a saved Terraform plan JSON to see which AWS IAM policy statements it adds and removes, then copy a pull-request note that keeps the counts and leaves out every name and value.
One file · .json · up to 10 MiB · stays in this tab
Loading the reviewer…
You get the statements added and removed in each policy, shown only on this page, and a pull-request note that keeps counts and leaves out every name and value.
- Managed policies:
aws_iam_policy - Inline role policies:
aws_iam_role_policy - Role trust policies:
aws_iam_role
PR note
Identifiers omittedCounts only. No addresses, names, ARNs, actions or values.
What it does
Terraform shows an IAM policy change as one long JSON string, so a reordered statement looks the same as a new permission. This page reads the saved plan in your browser, compares each managed policy, inline role policy and role trust policy statement by statement, and lists what was added and removed. It then writes a pull-request note from fixed words and counts only, so you can say what kind of IAM change a PR makes without pasting role names, account IDs or actions into a review thread.
Worked example: a deploy role gains iam:PassRole
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::contoso-deploy-artifacts/*"
}{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::contoso-deploy-artifacts/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
}
}{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::000000000000:role/contoso-deploy-worker"
}### IAM policy changes - Managed permissions: 1 statement added, 0 removed, 1 document with top-level field changes. - Inline permissions: 2 statements added, 1 removed, 0 documents with top-level field changes. - Role trust: 1 statement added, 1 removed, 0 documents with top-level field changes. - Unreviewed IAM resource changes: 1.
The role name, bucket and actions stay on your screen; only the counts go into the pull request.
How to use it
- Save the plan as JSON:
terraform plan -out=plan.tfplan, thenterraform show -json plan.tfplan > plan.json. - Drop
plan.jsonon the page or choose it. - Read the added and removed statements, then press Copy PR note and paste it into the pull request.
What it does not do
- It compares three fields: aws_iam_policy policy, aws_iam_role_policy policy and aws_iam_role assume_role_policy. Changes to role inline_policy and managed_policy_arns, attachment resources and other unsupported IAM changes are listed as unreviewed.
- It compares statements as written. It does not work out effective access or score privilege escalation.
- Deferred IAM changes, policy values unknown until apply and policy numbers outside safe integer precision are listed as unreviewed.
- Nothing you open is uploaded, saved or put in the address bar.
Questions
Why does an edited statement show as one removed and one added?
Statements are compared whole. Any change inside one, even a single action, makes it a different statement. The old one appears under Statements removed and the new one under Statements added.
Does reordering statements count as a change?
No. Statements are matched regardless of order, and key order inside them is ignored. Order inside lists, such as Action, still counts.
What exactly goes into the PR note?
A heading and four lines of counts, built from fixed words. No resource address, role or policy name, ARN, statement ID, action, principal, condition or file name.
Is my plan sent anywhere?
No. The file is read and compared in this tab. Once the page and reviewer have loaded, it works with the network off. Closing the tab clears the review.


