Sub topic 11
Designing groups and permission sets that scale
This chapter assumes you know the basics of IAM roles and policies, and that you have seen how an account assignment ties a principal, a permission set, and an account together. It also assumes you can run AWS CLI commands. The focus here is design: which groups and permission sets to create so that adding the 200th account is no harder than adding the 5th.
The multiplication problem
Every account assignment is one combination of three things: a principal, a permission set, and an account. If you assign users individually, the number of assignments grows with users × permission sets × accounts. If you assign groups, it grows with groups × permission sets × accounts. The design goal is to keep each of those numbers small, and to make the remaining ones follow a rule you can state in one sentence.
Three decisions control the count:
- What a principal is (always a group, never a person).
- What a permission set represents (a job function, not an account).
- How groups map to accounts (a naming convention that encodes the mapping).
Assign groups, not users
Assign permission sets to groups in almost every case. Access then changes through group membership, which your identity provider (IdP) or directory already manages, and you never touch the assignment list when someone joins or leaves a team.
Direct user assignments are the exception. Use them for a temporary break-glass user or a one-off case, and record why. They are easy to forget and do not appear in any group review.
If your identity source is an external IdP with automatic provisioning (SCIM), the IdP owns the groups and their members. Create and edit groups there, because changes made directly in Identity Center can be overwritten at the next sync. If you use the built-in Identity Center directory, you manage groups yourself:
IDENTITY_STORE_ID=$(aws sso-admin list-instances --query 'Instances[0].IdentityStoreId' --output text)
GROUP_ID=$(aws identitystore create-group \
--identity-store-id "$IDENTITY_STORE_ID" \
--display-name "aws-prod-Developer" \
--description "Developers in production accounts" \
--query 'GroupId' --output text)
USER_ID=$(aws identitystore get-user-id \
--identity-store-id "$IDENTITY_STORE_ID" \
--alternate-identifier '{"UniqueAttribute":{"AttributePath":"UserName","AttributeValue":"[email protected]"}}' \
--query 'UserId' --output text)
aws identitystore create-group-membership \
--identity-store-id "$IDENTITY_STORE_ID" \
--group-id "$GROUP_ID" \
--member-id UserId="$USER_ID"Do not plan on nested groups. Identity Center assigns access to the groups it knows about and their direct members, so a group that contains other groups should be flattened in your IdP before it syncs.
Permission sets describe jobs
A permission set is a template for the role that appears in each account. Make it describe what a person does, and keep it identical everywhere it is assigned. Typical job-function sets are:
ReadOnlyAuditor: AWS managedReadOnlyAccess.Developer: managedPowerUserAccessor a narrower custom set, plus a permissions boundary if you need a ceiling.PlatformAdmin: broad administrative access, short sessions.BillingViewer: billing and cost views only.BreakGlass: full administrator, assigned to a tightly controlled group and monitored.
Avoid names such as ProdAppTeamAWorkaround. A permission set named after an account or a team is a sign that you are encoding the mapping in the wrong place. The mapping between people and accounts belongs in the group and in the assignment. The permission set only says what the access allows.
When you must vary a permission set across accounts, for example a policy that references an account-specific bucket, do not make a new permission set per account. Use a customer managed policy reference, which points to a policy of the same name that you create in each target account. The permission set stays single, and the policy content differs per account. The cost is that the policy must exist in every target account before you provision, which a later chapter covers.
Encode the mapping in group names
A group name should tell you who is in it and what it grants without opening the console. A common pattern combines a scope and a permission set:
| Group name | Scope | Permission set | Assigned to |
|---|---|---|---|
| `aws-prod-Developer` | Production accounts | `Developer` | All accounts in the Prod OU |
| `aws-nonprod-Developer` | Non-production accounts | `Developer` | All accounts in the Nonprod OU |
| `aws-all-ReadOnlyAuditor` | Every account | `ReadOnlyAuditor` | All member accounts |
| `aws-sec-PlatformAdmin` | Security tooling accounts | `PlatformAdmin` | Security OU accounts |
| `aws-acct123456789012-Developer` | One account | `Developer` | A single account |
The first four are scope-based groups. They line up with your OU structure, so a new account that lands in the Prod OU needs the same assignments as its siblings. The last row is an account-specific group. Use that pattern sparingly, only for an account that is genuinely different, because each one adds assignments you must maintain.
The group name is documentation, but Identity Center does not enforce it. The real mapping is the set of assignments, so keep the two in agreement through automation rather than by hand.
Keep the design flat and reviewable
Every extra layer makes access reviews harder. Some rules help:
- One group should have one meaning. If a group grants
Developerin prod andReadOnlyAuditorin nonprod, split it. - Prefer many small, single-purpose groups over a few large, mixed ones. A person who needs three kinds of access joins three groups.
- Give each group an owner and a description, such as the team lead or the ticket queue that approves membership.
- Separate duty from scope.
Developerin prod andDeveloperin nonprod share a permission set but have different groups, so you can require stricter approval for the prod one without changing the permission set.
Review cost is the real measure of a design. For any group, you should be able to answer three questions quickly: who is in it, what does it allow, and where. If answering takes more than a minute, the design has leaked some mapping into the wrong place.
Common mistakes
- One permission set per account. This is the most common error, and it makes later policy changes a hundred separate edits. Move the account variation into the group, or into a customer managed policy.
- Assigning individual users for convenience. The access works today and is invisible in the next review.
- Permission sets with no ceiling. If many people can create roles or attach policies, add a permissions boundary to
Developerso those actions cannot exceed what you intended. - Long sessions on privileged sets. A twelve-hour
PlatformAdminsession outlives the offboarding conversation. - Letting group names drift. If a group named
aws-prod-Developeris also assigned to a sandbox account, the name now misleads reviewers.
A short checklist before you build
- List the job functions. Each becomes one permission set.
- List the scopes, normally one per OU or per environment. Each scope and permission set pair becomes one group.
- Write the naming convention down and apply it to every group.
- Decide which groups are managed by the IdP and which, if any, live in Identity Center.
- Decide where per-account variation goes: a customer managed policy, not a new permission set.
Once the groups and permission sets follow these rules, the assignment list becomes a table you can generate rather than a list you maintain by hand. The next chapter shows how to produce that table across many accounts and OUs.
Exercise
A team has 40 accounts, and the platform team creates a separate permission set named after each account so every account can have slightly different S3 access. What is wrong with this design, and what would you change?
Show answer
It creates 40 permission sets that must each be edited and re-provisioned whenever a shared policy changes, and the account name is encoded in the wrong place. Use one job-function permission set (for example Developer) and assign scope-based groups to the accounts. Handle the account-specific S3 access with a customer managed policy of the same name that exists in each target account, referenced from the single permission set.
Exercise
A user is removed from the aws-prod-Developer group at 10:00. Their session was issued at 09:30 with a duration of PT8H. When does their access in the production account end, and what could you change to shorten it?
Show answer
Their existing session keeps working until it expires at 17:30, because removing group membership does not revoke an issued session. To shorten the window, lower the permission set's session duration (for example PT1H) so that sessions expire sooner.