AWS IAM (Identity and Access Management)
AWS IAM (Identity and Access Management) controls access to everything in an AWS account. For every API call it does two jobs: it checks the request signature to learn who is calling, and it checks policies to decide whether that caller may run that action on that resource. Those are the two halves of authentication vs authorization. IAM is global, not regional, and has no extra charge.
How it works
There are three kinds of things to keep apart. An IAM user is a long-lived identity with a password or access keys that stay valid until someone rotates or deletes them. An IAM role has no long-term credentials. An EC2 instance, a Lambda function, a CI job or a person signed in through IAM Identity Center assumes it and gets temporary credentials from AWS STS (Security Token Service), valid for 1 hour by default.
A policy is a JSON document of statements, each with an Effect, Action, Resource and optional Condition. Policies attach to users, groups and roles, and a role also has a trust policy that says who may assume it.
Evaluation is deny by default. A request is allowed only if some policy allows it, and an explicit Deny anywhere beats every allow. This least-privilege policy lets a deploy role upload a static site to one bucket and nothing else:
Any other call, such as s3:DeleteBucket or ec2:RunInstances, gets AccessDenied.
For example, a CI pipeline deploys with an IAM user whose access key has AdministratorAccess. The key leaks into a build log and is found 40 days later, so it was usable for 40 x 24 = 960 hours, against every service. Switch the pipeline to assume a role with the policy above, and a leaked credential works for at most 1 hour and can only write files to site-prod.
Why it matters in production
Most IAM trouble is permissions that grew and never shrank: wildcards like "Action": "*", access keys that are years old, and roles whose trust policy lets any principal in the account assume them. Prefer roles over users, scope Resource to real ARNs, and use IAM Access Analyzer or CloudTrail to find permissions nobody has used in 90 days.
See also
On the One2N blog
AWS SSM port forwarding to private EC2 without SSH or bastions
Multi-tenant SFTP: how we built a zero-ops setup on AWS Transfer Family
References
