Bird
0
0

What is the best approach to achieve this?

hard📝 Best Practice Q15 of 15
AWS - API Gateway
You want to create a REST API with a resource /users that supports GET and POST methods. You start with MOCK integration for both methods to test. Later, you want GET to fetch data from a Lambda function and POST to store data in DynamoDB via Lambda. What is the best approach to achieve this?
ACreate the API with MOCK integration first, then update GET and POST methods to use Lambda integration with proper permissions.
BCreate separate APIs for MOCK and Lambda integrations and switch clients between them.
CUse MOCK integration permanently because it is simpler and faster.
DDirectly connect POST method to DynamoDB without Lambda and keep GET as MOCK.
Step-by-Step Solution
Solution:
  1. Step 1: Start with MOCK integration for testing

    MOCK lets you test API behavior without backend, a good first step.
  2. Step 2: Update methods to Lambda integration

    Later, replace MOCK with Lambda integration for GET and POST to connect real backend logic.
  3. Step 3: Ensure permissions and backend setup

    Configure Lambda permissions and DynamoDB access properly for smooth operation.
  4. Final Answer:

    Create the API with MOCK integration first, then update GET and POST methods to use Lambda integration with proper permissions. -> Option A
  5. Quick Check:

    Start MOCK, then switch to Lambda integration [OK]
Quick Trick: Test with MOCK, then switch methods to Lambda integration [OK]
Common Mistakes:
  • Trying to use MOCK and Lambda in separate APIs
  • Keeping MOCK integration permanently
  • Connecting POST directly to DynamoDB without Lambda

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes