Security, Identity, and Compliance
IAM
Service that securely controls access to AWS resources: who is authenticated (signed in) and what permissions they have to use each resource. With it, you create identities, such as users and roles, and grant them permissions through policies.
Exam phrases that point here
«avoid storing access keys on the EC2 instance»
An IAM role attached to the instance (through an instance profile) delivers temporary credentials that renew themselves, so the application does not need keys stored in code or files.
When not: If the one who needs access is someone at the company who signs in to several accounts, the clue points to IAM Identity Center. And if the secret belongs to another system (for example, a database password), think of AWS Secrets Manager.
«grant access to resources in another AWS account»
The account that owns the resources creates a role with a trust policy that trusts the other account; users or roles in that other account assume it and get temporary credentials.
When not: For some resources (S3 buckets, SQS queues, KMS keys), a resource-based policy is enough, with no role to assume. If the goal is to use the same network or infrastructure resource from several accounts (subnets, transit gateways), it is usually AWS RAM.
«principle of least privilege»
IAM lets you limit each permission to specific actions, resources, and conditions, and offers tools (IAM Access Analyzer, last accessed information) to trim what is left over.
When not: Least privilege is a principle that shows up across many services. If the scenario is about putting a permissions ceiling on entire accounts in an organization, the answer is AWS Organizations SCPs, which do not grant permissions by themselves.
«identify resources shared with entities outside the account»
IAM Access Analyzer reviews policies and flags which resources are accessible from outside the account or organization, in addition to permissions that nobody uses.
When not: If what you are looking for is who made a specific call and when, the clue points to AWS CloudTrail. If the ask is to evaluate resource configuration against rules over time, to AWS Config.
«grant permissions based on tags as resources grow»
With ABAC, permissions depend on the role's or session's tags matching the resource's tags, so new resources are covered without rewriting policies.
When not: If permissions depend on the job function and the environment is stable, the usual approach is RBAC with roles per function. ABAC depends on tags: a resource without the right tag is not covered.