← Back to Home

Advanced Identity

STS, Cognito, Directory Services, IAM Identity Center & RAM

AWS STS (Security Token Service)

Key API Calls

API CallDescription
AssumeRoleAssume a role within your account or cross-account. Returns temporary credentials.
AssumeRoleWithSAMLReturn credentials for users logged in with SAML (corporate identity federation).
AssumeRoleWithWebIdentityReturn credentials for users logged in with a web identity provider (Google, Facebook, OIDC). AWS recommends using Cognito instead.
GetSessionTokenGet temporary credentials for an IAM user or root user (for MFA).
GetCallerIdentityReturn details about the IAM user or role whose credentials are used to call the API.
DecodeAuthorizationMessageDecode error messages when an API call is denied.

How AssumeRole Works

Exam Tip:

STS provides temporary credentials. Think of it whenever the question mentions temporary access, cross-account access, or assuming a role.

Amazon Cognito

Provides identity for web and mobile application users (potentially millions of users). Instead of creating IAM users for every app user, use Cognito.

Cognito User Pools (CUP)

Cognito Identity Pools (Federated Identities)

User Pools vs Identity Pools

FeatureUser PoolsIdentity Pools
PurposeAuthentication (who you are)Authorization (what you can access)
ReturnsJWT tokenTemporary AWS credentials (via STS)
Use CaseSign-up/sign-in for your appAccess AWS services (S3, DynamoDB, etc.)
Social LoginYesYes (through User Pool or directly)
Guest AccessNoYes
Key Point:

Cognito User Pools = sign-up/sign-in (authentication). Cognito Identity Pools = temporary AWS credentials (authorization). They can work together: User Pool authenticates, then Identity Pool grants AWS access.

AWS Directory Services

AWS provides three directory service options to integrate with Microsoft Active Directory (AD).

What is Microsoft Active Directory?

Three Directory Service Options

ServiceDescriptionUse Case
AWS Managed Microsoft AD Create your own AD in AWS. Fully managed, runs on Windows Server. Supports MFA. Establish trust connection with on-premises AD (users exist in both). You need a full-featured Active Directory in AWS, possibly with trust to on-premises AD.
AD Connector A proxy (gateway) to redirect directory requests to your existing on-premises AD. Users are managed only on-premises. Supports MFA. You want to use your existing on-premises AD with AWS services. No caching, purely a proxy.
Simple AD AD-compatible managed directory powered by Samba 4. Basic AD features. Cannot be joined with on-premises AD (no trust). You need a basic, low-cost AD in the cloud with no on-premises integration.
Exam Tip:

Managed Microsoft AD = full AD in AWS, can trust on-premises. AD Connector = proxy to on-premises AD (no AD in AWS). Simple AD = standalone basic AD in AWS (no on-premises connection).

AWS IAM Identity Center (Successor to AWS SSO)

Identity Providers

How It Works

Fine-Grained Permissions

Key Point:

IAM Identity Center = one login for all AWS accounts and business apps. It's the recommended way to manage human user access to multiple AWS accounts. Successor to AWS SSO.

AWS Resource Access Manager (RAM)

Resources You Can Share

ResourceDetails
VPC SubnetsAllow other accounts to launch resources in your VPC subnets. All resources must be in the same AWS Organization. Cannot share security groups or the default VPC.
AWS Transit GatewayShare a Transit Gateway across accounts for centralized network connectivity.
Route 53 Resolver RulesShare DNS resolver rules across accounts.
License Manager ConfigurationsShare software license configurations.
Aurora DB ClustersShare Aurora clusters across accounts.
ACM Private Certificate AuthorityShare private CA across accounts.
CodeBuild ProjectsShare build projects across accounts.
EC2 (Dedicated Hosts, Capacity Reservations)Share dedicated resources across accounts.

VPC Subnet Sharing Details

Exam Tip:

RAM = share resources across accounts without duplication. Most commonly asked about VPC subnet sharing and Transit Gateway sharing. This is different from IAM Identity Center (which shares access, not resources).

Quick Comparison: Identity Services

ServicePurposeUsers
IAMManage AWS account accessInternal users (developers, admins)
STSTemporary credentialsUsers/services needing short-lived access
CognitoApp user identityExternal users (web/mobile app users, millions)
Directory ServicesMicrosoft AD integrationCorporate users with existing AD
IAM Identity CenterSSO for multiple accounts/appsOrganization users needing central login
RAMShare resources across accountsOther AWS accounts in your org
Key Point:

IAM = internal AWS users. Cognito = external app users. IAM Identity Center = SSO across accounts. STS = temporary credentials. RAM = resource sharing.