When I use API-Gateway to define my endpoints, some of my endpoints are only accessible from a signin-ed user. (I am using Cognito User Pool to manage my users)
I see different ways to achieve this goal
SigV4, see Page 19;
JWT token from Cognito User Pool, see Page 23
Right now, I am using option 2, but I don't understand when I should use option 1. Are they essentially just different approaches to achieve the same goal or are they different?
Although with a bit of effort they can be used 'semi'-interchangeably, there's a different intent behind each:
For most API gateway uses I would expect Cognito (or API Keys) to be the best option. Although there are architectural patterns where you give your API users direct access to resources in your account through temporary IAM credentials.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With