STS, Cognito, Directory Services, IAM Identity Center & RAM
sts.amazonaws.com (can also use regional endpoints).| API Call | Description |
|---|---|
AssumeRole | Assume a role within your account or cross-account. Returns temporary credentials. |
AssumeRoleWithSAML | Return credentials for users logged in with SAML (corporate identity federation). |
AssumeRoleWithWebIdentity | Return credentials for users logged in with a web identity provider (Google, Facebook, OIDC). AWS recommends using Cognito instead. |
GetSessionToken | Get temporary credentials for an IAM user or root user (for MFA). |
GetCallerIdentity | Return details about the IAM user or role whose credentials are used to call the API. |
DecodeAuthorizationMessage | Decode error messages when an API call is denied. |
STS:AssumeRole.STS provides temporary credentials. Think of it whenever the question mentions temporary access, cross-account access, or assuming a role.
Provides identity for web and mobile application users (potentially millions of users). Instead of creating IAM users for every app user, use Cognito.
| Feature | User Pools | Identity Pools |
|---|---|---|
| Purpose | Authentication (who you are) | Authorization (what you can access) |
| Returns | JWT token | Temporary AWS credentials (via STS) |
| Use Case | Sign-up/sign-in for your app | Access AWS services (S3, DynamoDB, etc.) |
| Social Login | Yes | Yes (through User Pool or directly) |
| Guest Access | No | Yes |
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 provides three directory service options to integrate with Microsoft Active Directory (AD).
| Service | Description | Use 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. |
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).
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.
| Resource | Details |
|---|---|
| VPC Subnets | Allow 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 Gateway | Share a Transit Gateway across accounts for centralized network connectivity. |
| Route 53 Resolver Rules | Share DNS resolver rules across accounts. |
| License Manager Configurations | Share software license configurations. |
| Aurora DB Clusters | Share Aurora clusters across accounts. |
| ACM Private Certificate Authority | Share private CA across accounts. |
| CodeBuild Projects | Share build projects across accounts. |
| EC2 (Dedicated Hosts, Capacity Reservations) | Share dedicated resources across accounts. |
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).
| Service | Purpose | Users |
|---|---|---|
| IAM | Manage AWS account access | Internal users (developers, admins) |
| STS | Temporary credentials | Users/services needing short-lived access |
| Cognito | App user identity | External users (web/mobile app users, millions) |
| Directory Services | Microsoft AD integration | Corporate users with existing AD |
| IAM Identity Center | SSO for multiple accounts/apps | Organization users needing central login |
| RAM | Share resources across accounts | Other AWS accounts in your org |
IAM = internal AWS users. Cognito = external app users. IAM Identity Center = SSO across accounts. STS = temporary credentials. RAM = resource sharing.