A request is anything someone asks AWS to do, such as reading a file, creating a server or deleting a table. Every time a user, a role or a service makes a request, AWS checks the policies that apply and decides whether to allow it or deny it. A policy is a text document with rules, and each rule says Allow or Deny for certain actions on certain resources. For example, a policy at an online store can say "Allow: read the product photos" for the site's program.
The basic rule is that everything starts denied, an Allow opens access and an explicit Deny, that is, one written in some policy, always wins. For example, if one policy lets the store's support person read the orders and another denies reading them, they can't read them. What the Solutions Architect exam adds is that several types of policies can take part in a single request, where some grant permissions and others only set a maximum.
Identity policies and resource policies
An identity policy is attached to a user, group or role and says what that identity can do. It can be managed, which is a policy stored separately that is attached to several identities and is written by AWS or by you, or inline, which is a policy written inside a single identity. It doesn't include the Principal element, which is the part of the policy that says whom it applies to, because the principal is the identity it is attached to. For example, the store writes a managed policy called "order read access" and attaches it to the whole support group.
A resource policy, on the other hand, is attached to the resource, such as an S3 bucket, an SQS queue or a KMS key. It says who can use that resource, which is why it does include the Principal element, and it is always inline. A role's trust policy is also a resource policy, because it says who can assume the role. For example, the policy on the store's photo bucket says the site's role can read and write in it.
Within the same account, in general it is enough for one of the two policies to allow the request. For example, if a bucket policy names a user, she can read even if her identity policy says nothing about S3. This rule has two exceptions: for KMS keys and for role trust policies, the resource policy always has to allow the request.
Policies that only set a maximum

Besides the policies that grant permissions, there are four types that never grant anything and only set the maximum an identity can end up having:
- The permissions boundary, which is a managed policy that is attached to a user or role and sets the maximum its identity policies can give it.
- The service control policy (SCP) of AWS Organizations, the service that groups several AWS accounts of the same company, which sets the maximum for all the users and roles in the member accounts (the accounts inside that organization), including the root user of each one.
- The resource control policy (RCP) of AWS Organizations, which sets the maximum for the resources in the member accounts, wherever the request comes from.
- The session policy, which is passed when assuming a role with the AssumeRole call and trims the permissions only for that session.
These four types work like a ceiling: they say how far permissions can go, but something else has to grant the permission. For example, if one of the store's SCPs allows using S3 and no identity policy gives S3 to the support person, they still can't use S3.
In what order does AWS evaluate the policies?

AWS checks the policy types in a fixed order of seven steps. Step 1 looks for an explicit Deny in any policy, and if it finds one the request is denied right there. Then steps 2 and 3 check that the action is allowed by the RCPs of the resource owner and by the SCPs of the principal's account, which is whoever makes the request.
Step 4 is the resource policy shortcut within the same account, which explains why in that case it is enough for the resource to allow the request. If that shortcut doesn't apply, the identity policy has to allow the action (step 5). Finally, if they exist, the permissions boundary (step 6) and the session policy (step 7) also have to allow it. For example, when the store's site program asks to upload a photo to the bucket in its own account, AWS first looks for a Deny; if there is none and the SCPs allow it, it is enough for the bucket policy or the site role's policy to give the Allow.
Policies that add up and policies that intersect

The evaluation order can be summed up in two rules. The first is that the identity policy and the resource policy add up, so it is enough for one of them to allow the request. The second is that the limiting policies intersect, so the effective permission is only what all of them allow at the same time, like the space where two circles overlap. For example, a role with the AdministratorAccess policy, which allows everything, and that also has a permissions boundary that only allows S3, in an account with an SCP that denies everything outside two Regions, ends up using S3 in those two Regions and nothing else.
SCPs have a quirk that the exam uses in its scenarios. When you turn on SCPs, Organizations attaches the FullAWSAccess policy, which allows everything, at every level, and if someone replaces it with an SCP that only allows certain services, the rest of the services are off limits for those accounts. A level can be the whole organization, an account or an organizational unit (OU). For example, if FullAWSAccess is removed from the store's test OU and replaced with an SCP that only allows EC2, nobody in those accounts can create an S3 bucket, even an administrator.
What is a permissions boundary for?
A permissions boundary is for delegating, which means letting someone else do a task that only you used to do. For example, the platform team wants developers to create roles for their Lambda functions without opening a ticket, but without anyone being able to give themselves more permissions than they should have.
That delegation is built with three pieces. The first is a managed policy that defines the maximum, and the second is a policy for the developers that only lets them create roles if they attach that boundary, with the iam:PermissionsBoundary condition; a condition is the part of a policy that says when a rule applies. The third is a deny so they can't edit or remove the boundary. With that, even if someone creates a role with AdministratorAccess, the boundary trims it.
The boundary is set identity by identity and within one account, so to set a maximum for many accounts at once you use an SCP. An IAM group doesn't work for applying a policy to several roles either, because a group only contains users. For example, if the store wants a maximum for the roles its developers create in one account, it uses a permissions boundary; if it wants a maximum for every account in its organization, it uses an SCP.
In a new experience account
In a new experience account the evaluation works the same way. AWS publishes the SCPs and the RCP it puts in your projects, so you can read real examples of both, but you can't write your own SCPs or RCPs, because AWS manages them. Also, IAM Access Analyzer, a service that reviews your policies and warns about mistakes or excess access, is only available for validating policies. For example, in that account you can write the policy for the store's site role and ask Access Analyzer to review it, but you can't create your own SCP.
How does it show up on the exam?
Policy evaluation questions ask you to predict whether a request is allowed or to choose which policy sets a limit, and these phrases in the question point to the answer:
| If the question says |
The answer |
| "An Allow in IAM and a Deny in the bucket policy" |
It is denied |
| "Limit all the accounts in an OU" or "prevent them from using certain Regions" |
An SCP |
| "Let developers create roles without being able to escalate their permissions" |
A permissions boundary |
| "Limit who from outside the organization accesses the buckets" |
An RCP or an aws:PrincipalOrgID condition, which checks which organization the principal belongs to |
For example, if the question says one of the store's roles has AdministratorAccess but the bucket policy denies it read access, the answer is that it can't read, because an explicit Deny always wins.