Skill 2.1.8
Handle cross-service authentication in microservice architectures
Key Concepts
Within AWS, each service should run with its own IAM role and call other services' APIs using SigV4, for example through API Gateway with IAM authorization or private APIs reachable only from a VPC endpoint. Resource-based policies on queues, topics, functions and buckets state exactly which service roles may use them.
For service-to-service calls using tokens, Cognito supports the OAuth 2.0 client credentials grant, where a service authenticates with a client ID and secret and receives an access token with specific scopes. Mutual TLS on API Gateway custom domains authenticates clients by certificate.