SAP-C02 Practice Question 95: HTTP API JWT Low Cost
AWS Certified Solutions Architect – Professional (SAP-C02) · Test 10 · question 5 of 10
A company is building a public API backed by AWS Lambda functions for a mobile app. Users sign in with an Amazon Cognito user pool, and the API must validate the resulting JSON Web Tokens and allow cross-origin requests from the company's web site. The API does not need API keys, per-client rate limiting, request validation, AWS WAF integration, response caching or private endpoints. The company wants the lowest cost and the least configuration.
Which solution meets these requirements?
Show answer and explanation
Answer:
AWS explains that *"REST APIs support more features than HTTP APIs, while HTTP APIs are designed with minimal features so that they can be offered at a lower price."* It advises to *"choose REST APIs if you need features such as API keys, per-client throttling, request validation, AWS WAF integration, or private API endpoints,"* and to *"choose HTTP APIs if you don't need the features included with REST APIs."* HTTP APIs support JWT authorizers (and Amazon Cognito through a JWT authorizer), CORS configuration and Lambda integrations, so an HTTP API is the cheaper fit (option B).
- A is wrong because usage plans and API keys are REST API features that the company does not need, and they cost more. - C is wrong because a private REST API is only reachable from inside a VPC, but this is a public API for a mobile app. - D is wrong because caching and AWS WAF are REST API features that the company explicitly does not need, and they add cost.
Reference: Choose between REST APIs and HTTP APIs