Why IAM matters
AWS Identity and Access Management, commonly called IAM, controls who can access AWS resources and what they are allowed to do.
IAM initially felt complicated because several terms appeared together: users, roles, policies, permissions, and least privilege. I found it easier to understand them by treating IAM as an access-control system that answers two questions:
- Who or what is requesting access?
- Which actions should that identity be allowed to perform?
IAM users
An IAM user represents a person or application that needs long-term access to an AWS account.
A user can have credentials, but credentials should be protected carefully. The AWS account root user should not be used for ordinary work. Multi-factor authentication should also be enabled wherever possible.
IAM roles
A role provides temporary permissions. Instead of storing permanent credentials, a trusted identity assumes the role when it needs access.
Roles are useful for:
- Allowing an EC2 instance to access another AWS service
- Giving a Lambda function permission to read from Amazon S3
- Providing temporary access to administrators
- Enabling access between AWS accounts
Roles reduce the need to distribute long-term credentials.
IAM policies
A policy is a JSON document describing allowed or denied actions.
A policy can define:
- Conditions that must be satisfied
- Whether access is allowed or explicitly denied
For example, an application might receive permission to read objects from one specific S3 bucket without being allowed to modify or delete them.
Least privilege
The principle of least privilege means granting only the permissions required for a task.
A beginner might be tempted to use broad permissions because they make an application work quickly. However, excessive permissions increase the possible damage caused by mistakes or compromised credentials.
A safer process is:
- Grant the smallest practical set of permissions.
- Review access as the application changes.
- Remove permissions that are no longer required.
A simple example
Imagine a monitoring application that reads sensor files from an S3 bucket.
The application needs permission to read those files, but it probably does not need permission to delete the bucket, create IAM users, or launch EC2 instances. An IAM role with narrowly scoped S3 permissions would be safer than attaching a broad administrator policy.
What I learned
IAM is easier to understand when I separate identities from permissions:
- Users normally represent identities with long-term credentials.
- Roles provide temporary access.
- Policies define what actions are permitted.
- Least privilege keeps permissions appropriately limited.
For beginners, building secure access habits early is more valuable than fixing excessive permissions later.
Which IAM concept was the most confusing when you started learning AWS?
Loading article