What this thread does
Do first: inventory this service's required API operations and resource ARNs, then evaluate a candidate with iam:SimulatePrincipalPolicy before removing its broad policy.
Short answer
As of November 2026, use current IAM docs. Generate a candidate from representative access history, add infrequent recovery/startup operations, and narrow each action to supported resources and conditions. An observed API call is evidence to review, not permission to grant automatically; denied calls appear in generation too. Policy generation.
Choose / don't choose
- Explicit ARNs: choose a small stable resource set; don't widen to
*merely to suppress a denial. In the all-resources case, use*in the Resource element. Resource element. - ABAC: choose growing sets with enforced ownership tags and action/service support; don't use tags if the workload can retag itself into access. Control tag writes as well as reads. Some services require service-specific keys. Tag controls.
- Generated policy: choose a starting inventory; don't assume history covers disaster recovery or data-plane calls. Generation omits action-level data events and
iam:PassRole. Generation.
Not for: GitHub Actions OIDC role assumption; see github-actions-oidc-credentials-runner-communication-errors.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
Resource | Exact service ARN(s); In the all-resources case, use * in the Resource element | Current IAM | Resource element |
Condition.StringEquals | Supported aws:ResourceTag/Owner matched to intended owner; official example matches ${aws:username} for IAM users, not a universal service-role identity | Current IAM; service/action dependent | Tags |
aws:TagKeys / aws:RequestTag/environment | Restrict writable keys and permitted values; example preprod / production | Current IAM; tagging-capable services | Tags |
--policy-source-arn / --action-names | Role ARN and each required/forbidden action; principal simulation includes attached policies | Current AWS CLI docs | CLI |
--resource-arns / --context-entries | Actual candidate resource ARNs and required context; resource default is *, unsuitable for a precise check | Current AWS CLI docs | CLI |
--policy-exclusion-list / --policy-input-list | Exclude the policy being replaced, add additional policy documents | Current AWS CLI docs; confirm installed CLI exposes option | CLI |
Order of operations
1. Identify the runtime role, attached/inline policies, boundaries, session restrictions and resource policies. Map each business operation to its AWS action, resource type and supported condition keys. Include startup, maintenance and recovery paths. Mathangi Ramesh's April 7, 2021 article supplies the history-based starting method. 2. Review the generated template and add missing resource/condition constraints. Do not remove an infrequent operation simply because it was absent from the observation window. Generation. 3. Use aws iam simulate-principal-policy using --policy-source-arn for the source role. Use policy exclusion to test removal of a policy. Inspect decisions, matched statements and missing context; require allowed intended operations and denied neighboring resources. If the installed CLI lacks exclusion support, use an isolated equivalent role or custom-policy simulation rather than treating an additive allow as a replacement result. CLI, simulator modes. 4. Exercise representative operations under the isolated candidate identity, then replace the old policy with a rollback copy retained. Simulator results can differ for endpoints, role chaining or multiple resource policies. Simulator limits.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
with an explicit deny | A matching deny overrides an allow | Read policy-type context and matching deny; change the authorized boundary/SCP/resource/identity statement, not add another Allow | Denied-request guide |
because no permissions boundary allows | Boundary omits the operation even if identity policy allows it | Review boundary and identity permissions together; authorize only the necessary action/resource | Denied-request guide |
because no identity-based policy allows | Missing allow | Identify runtime principal and actual action/resource/context; add a narrowly scoped matching allow | Denied-request guide |
Gauravee Gandhi's August 27, 2021 diagnostic announcement explains policy-type context; parse error codes rather than depending on an entire human-readable message.
Rohan Devikoppa Shreedhara's May 15, 2026 report reports that the simulator allows a caller despite an explicit trust-policy deny. The maintainer cites the documented lack of IAM-role resource-policy simulation; do not extend this service-policy check into a role-trust guarantee.
Missing
- Confirmed by the linked CLI source: additional candidate policies are included alongside attached policies unless those policies are excluded.
- Confirmed by the linked evaluation source: applicable permissions are evaluated together; retaining broad grants cannot demonstrate least privilege.
- Exact required
Actionentries cannot be listed: no service API inventory or representative access history is specified. - Exact
ResourceARNs and the service's unscopable actions cannot be enumerated without its resource/account/region inventory and service authorization table. The tag examples above describe selection rules, not a deployable service policy.
Checked
2026-11-12; current docs, November 2026. Sources read: IAM generation, resource, tag, denial, simulator/CLI references Ramesh/Gandhi dated announcements and Shreedhara report. No AWS commands executed.
Started from a post by @AWS, packaged by the editor. Original post