Introduction
Ask most teams why they care about IAM and they'll say security. They're not wrong. But they're only half right, and the half they're missing is costing them weeks of engineering time every year.
Poorly designed IAM is a developer velocity problem as much as a security problem. When a developer can't deploy a new Lambda function because their IAM role is missing a permission that nobody documented, when a new engineer spends their first week waiting for an access ticket to resolve, when a CI/CD pipeline fails at 11pm because someone tightened a policy without checking what depended on it, that's all IAM. And none of it shows up in a security audit.
AWS IAM best practices are usually framed as a list of things to lock down: enable MFA, use roles not users, apply least privilege, rotate credentials. That framing is incomplete. IAM is the layer that determines how people and systems interact with your infrastructure. Design it around security alone and you'll build something that's technically safe and operationally miserable. Design it as an organizational system (one that reflects how your teams actually work, what they actually need, and how access evolves over time), and you get both security and velocity.
This post is about how to think about IAM that way, and what that thinking looks like in actual AWS configuration.
The Hidden Cost of IAM Designed Only for Security
IAM debt accumulates the same way technical debt does, quietly, through small decisions that each seem reasonable, until the accumulated weight of them starts affecting your ability to ship.
The most common pattern: a security-conscious engineer writes a tight IAM policy for a service role. They test it against what the service does today. Everything works. Three months later, the service needs to write to a new S3 bucket. The deployment fails. A developer opens a ticket. Someone with IAM access reviews it, adds the permission, the deployment unblocks. This cycle repeats dozens of times a year across a mature engineering organization. Each cycle takes hours. None of it shows up as a line item anywhere.
What makes this worse is that the policy that was written tightly three months ago is now being modified under time pressure, usually by someone other than the original author, without full context about why certain decisions were made. The original principle of least privilege erodes incrementally: not because anyone made a bad decision, but because there was no system designed to evolve the policy alongside the service.
There's a second failure mode that operates in the opposite direction: access sprawl through over-provisioning. Teams that have been burned by access delays tend to overcorrect. They start provisioning broad permissions (s3:*, ec2:*, sometimes *:* "just for the dev environment"), to avoid the interruption cycle. Dev IAM roles that started as tight, time-limited configurations become effectively unrestricted over months of "just this once" additions. Then someone copies that dev role for a staging deployment. Then staging role policies get applied to production because the deadline is tomorrow.
I've inherited environments where the production application role had iam:* in it because a developer once needed to programmatically create a role for a feature and nobody cleaned it up. That's not a security culture problem. That's an IAM design problem.
The concrete organizational impact: in a survey of engineering teams I've worked with, access delays and IAM-related deployment failures are consistently in the top five causes of developer frustration, above slow CI/CD pipelines, above documentation gaps, above on-call fatigue. IAM design is a developer experience problem. Treat it like one.
AWS Deep Dive: IAM Patterns That Serve Both Security and Velocity
Getting IAM right means designing patterns that are both secure by default and operationally livable. These aren't in tension if you design them correctly. Here's what that looks like at the AWS level.
IAM Identity Center: Solving the Human Access Problem at Scale
IAM users with long-lived access keys are a known problem. The solution most teams land on, creating IAM roles and distributing temporary credentials, is right directionally but creates its own operational overhead when you're managing access across multiple accounts and dozens of engineers.
AWS IAM Identity Center (formerly AWS SSO) is the right answer for human access to AWS at any organization with more than a handful of engineers. It provides centralized access management across all accounts in your AWS Organization, integrates with your existing identity provider (Okta, Azure AD, Google Workspace), and issues short-lived, session-based credentials rather than long-lived access keys.
The operational leverage is in Permission Sets. Instead of managing IAM roles per account per person, you define Permission Sets centrally (think Developer-ReadOnly, Developer-Deployment, PlatformEngineer, SecurityAuditor), and assign them to accounts and groups in your identity provider. Adding a new engineer to the platform team means adding them to a group in Okta. Their AWS access propagates automatically. Removing them works the same way.
The non-obvious design decision: how granular to make Permission Sets. Too coarse (Developer-FullAccess) and you've recreated the over-provisioning problem with extra steps. Too granular (one Permission Set per service per environment) and the management overhead defeats the purpose. The right granularity is usually role-based, not resource-based: what does someone in this job function actually need to do their job? A backend engineer deploying to ECS needs ECS, ECR, CloudWatch Logs, and probably S3 access for build artifacts. They don't need RDS admin or IAM management. That's one Permission Set, applied to their development accounts.
Permission Boundaries: The Right Tool for Delegated Administration
Permission boundaries are one of the most powerful and least-used IAM features. They're the mechanism that lets you safely delegate IAM management to teams without giving them the ability to escalate their own privileges.
Here's the pattern: your platform team creates a permission boundary policy that defines the maximum permissions any role in a developer account can have. Developers can create and modify IAM roles for their services (which they need to do for Lambda execution roles, ECS task roles, and so on), but any role they create is automatically bounded by the permission boundary you set. They cannot create a role with iam:* or AdministratorAccess because the boundary doesn't include those.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowServiceRoleCreationWithBoundary",
"Effect": "Allow",
"Action": ["iam:CreateRole", "iam:PutRolePolicy", "iam:AttachRolePolicy"],
"Resource": "*",
"Condition": {
"StringEquals": {
"iam:PermissionsBoundary": "arn:aws:iam::ACCOUNT_ID:policy/DeveloperBoundary"
}
}
}
]
}
This policy, attached to a developer's IAM role or group, allows them to create roles only if those roles have the DeveloperBoundary permission boundary attached. If they try to create a role without the boundary, the API call fails. This is the mechanism that lets you say "developers can self-serve IAM for their services" without "developers can grant themselves any permission they want."
The gotcha that trips teams implementing this: permission boundaries restrict what a role can do, but they don't grant permissions. The effective permissions of a principal are always the intersection of their identity policy and their permission boundary. If your boundary policy includes s3:* but the role's identity policy only has s3:GetObject, the effective permission is s3:GetObject. You need both layers to work together.
Designing IAM Roles for Services: The Least Privilege Lifecycle
Service roles (the IAM roles your Lambda functions, ECS tasks, CodeBuild projects, and EC2 instances assume), are where least privilege actually matters most and where it most consistently degrades over time.
The pattern I use is a lifecycle model with three phases:
Phase 1, Bootstrap with CloudTrail analysis. Start with a permissive role scoped to the AWS service category (e.g., s3:* for services that interact with S3, not *:*). Run the service in a development environment. After two to four weeks of realistic usage, use IAM Access Analyzer to generate a policy based on the actual CloudTrail access activity. This gives you a least-privilege policy grounded in real behavior rather than guesswork.
aws accessanalyzer start-policy-generation \
--policy-generation-details '{"principalArn":"arn:aws:iam::ACCOUNT_ID:role/MyServiceRole"}' \
--cloud-trail-details '{"accessRole":"arn:aws:iam::ACCOUNT_ID:role/AccessAnalyzerRole","startTime":"2024-01-01T00:00:00Z","endTime":"2024-01-31T00:00:00Z","trails":[{"cloudTrailArn":"arn:aws:cloudtrail:us-east-1:ACCOUNT_ID:trail/MyTrail","allRegions":true}]}'
Phase 2, Apply and monitor. Replace the permissive bootstrap role with the generated policy. Set up a CloudWatch alarm on IAM AccessDenied events for the role, this is your early warning system for missing permissions.
Phase 3, Establish a review cadence. Re-run Access Analyzer policy generation quarterly or when the service's AWS API usage changes significantly. This keeps least privilege from being a one-time configuration rather than an ongoing posture.
Enjoying this so far?
Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.
No spam. Unsubscribe anytime.
Tradeoffs and Decision Framework
IAM design involves real tradeoffs that context-free best practices don't surface. Here's how to think through the decisions that actually matter.
Least privilege at deployment time vs. least privilege as an ongoing practice. Writing a tight policy when you first deploy a service is valuable. Assuming that policy stays appropriate as the service evolves is how you end up with broken deployments and access delays six months later. Least privilege requires a maintenance model, not just an initial configuration. If your organization doesn't have a plan for how IAM policies get reviewed and updated as services change, tighter policies create more operational friction without delivering sustained security benefit.
Centralized IAM management vs. delegated team autonomy. A centralized model where a security or platform team controls all IAM changes gives you consistency and auditability. It also creates a bottleneck for every service that needs new permissions. A delegated model with permission boundaries gives teams autonomy and removes the bottleneck, but requires mature guardrails and trust in your permission boundary design. The right answer depends on your organization's risk tolerance, the maturity of your team IAM practices, and whether you have a dedicated platform or security team to design and maintain the boundaries. At fewer than 20 engineers, centralized is usually fine. At 50+, the bottleneck problem dominates and delegation becomes necessary.
IAM roles vs. IAM users for service accounts. There is almost no valid use case for IAM users with long-lived access keys for services running on AWS. IAM roles with STS-issued temporary credentials are strictly better: they rotate automatically, don't require credential distribution, and are auditable at the assume-role level in CloudTrail. The argument for IAM users is usually "but our service runs on-premises and can't assume a role." For on-premises services, the right answer is IAM Roles Anywhere, which issues temporary credentials to workloads using X.509 certificates. Verify current IAM Roles Anywhere documentation for certificate authority requirements before implementing.
Over-specifying resource ARNs vs. using *. Resource: "*" in an IAM policy is a smell, but over-specifying resource ARNs creates brittle policies that break when resource names change. The right approach is to use resource-level conditions where the service supports them, for example, using tag conditions to scope S3 access to buckets tagged with the team or environment, rather than hardcoding bucket ARNs that will differ between dev and production.
Lessons from the Field
1. The first thing I do when inheriting an AWS environment is run IAM Access Analyzer and look at the findings. Not because I expect a breach, but because the findings tell me how the team thinks about IAM. An environment with no findings usually means someone is paying attention. Dozens of findings for external access on S3 buckets and KMS keys tells me IAM was treated as an afterthought and I should expect the same in other areas.
2. IAM changes that break production pipelines at 11pm are almost always undocumented. In an engagement with a media company, a security team member tightened a CodeBuild service role to remove ecr:GetAuthorizationToken, correctly, because that permission grants access to all ECR repositories in the account. They replaced it with repository-specific permissions. The intent was right. The problem: the change went in without updating the five other pipelines that used the same role and needed the old behavior. Document your IAM changes. Add them to your change management process. IAM is infrastructure.
3. Permission boundaries saved a developer access delegation project that would have otherwise required centralized IAM management indefinitely. A client wanted to give their three product engineering teams autonomy over their own service IAM roles without giving them the ability to escalate privileges. We designed a permission boundary that scoped developer-creatable roles to exactly the AWS services those teams used, applied it via SCP to all developer accounts, and within a week the access ticketing queue had dropped by 70%. The platform team still owned the boundary policy, that's the right scope for centralized control.
4. IAM Access Advisor is underused. The "Access Advisor" tab on any IAM role shows the last time each AWS service was accessed and from where. I use it to find permissions that haven't been used in 90 days before removing them, it's the simplest form of ongoing least-privilege hygiene and it requires no additional tooling. Build a quarterly review of Access Advisor data into your operational cadence.
Final Thoughts
IAM is infrastructure. It deserves the same version control, documentation, testing, and review cadence as your Terraform modules and your application code. When it's treated as a one-time configuration that security reviews periodically, you end up with policies that reflect the history of your organization more than its current security posture, and developer velocity that's quietly throttled by access delays nobody is tracking.
The shift toward treating AWS IAM best practices as organizational design rather than security compliance is where mature engineering organizations go. It means asking not just "is this secure?" but "does this give people what they need to move fast, and does it create a system that stays accurate over time?" Both questions need answers before you ship an IAM configuration.
Key Takeaways
- IAM design is a developer velocity problem, not just a security problem. Access delays, blocked deployments, and permission-related CI/CD failures are among the most common engineering frustrations, and they're all fixable with intentional IAM architecture.
- AWS IAM Identity Center with Permission Sets is the right model for human access at scale. It eliminates long-lived access keys, integrates with your identity provider, and lets you manage access by role across all accounts in your Organization without per-account IAM configuration.
- Permission boundaries are the mechanism that enables safe delegated IAM management. They let developers create service roles without being able to escalate their own privileges, removing the platform team bottleneck without removing the guardrails.
- Use IAM Access Analyzer to generate least-privilege policies from actual CloudTrail usage: not guesswork. Bootstrap with permissive scoped roles, run for two to four weeks in development, then generate and apply the policy based on real API call patterns.
- Least privilege requires a maintenance model. A tight policy written at deployment time will drift as the service evolves. Build quarterly Access Advisor reviews and CloudWatch alarms on AccessDenied events into your operational cadence to catch drift before it causes incidents.
- IAM users with long-lived access keys have almost no valid use case for workloads running on AWS. IAM roles with STS temporary credentials are strictly better. For on-premises workloads, evaluate IAM Roles Anywhere before falling back to static credentials.
- IAM changes that aren't tracked in version control and change management are how you get production outages at 11pm. IAM is infrastructure. Treat it accordingly.
Get insights like this in your inbox
Join thousands of engineers receiving practical engineering, Cloud, Distributed Systems, Infrastructure and AI engineering insights.
No spam. Unsubscribe anytime.