1. Create REST API

  1. Go to API Gateway console
  2. Create new REST API

  1. Create new resource and method
    • Add resource: e.g., “/user-list”
    • Add GET method
    • Integration type: Lambda Function
    • Select your Lambda function
  2. Enable CORS if needed
    • Actions → Enable CORS
    • Accept default settings for testing

2. Update “Method request”

3. Update “Integration request”

{
    "limit": "$input.params('limit')"
}

4. Deploy and Test

  1. Deploy API

  1. Note the API endpoint URL

  1. Test using curl or Postman:

    curl -X GET 'https://your-api-id.execute-api.region.amazonaws.com/stage/data' \
    -H 'x-api-key: your-api-key-here'
    

See also:

AWS Credentials for CLI

AWS STS - Temporary Access Tokens

Amazon DynamoDB - Create a Table

Amazon DynamoDB - Import CSV Data

AWS Lambda - Create a Function

AWS Lambda - Grant Access

API Gateway - Usage Plan

API Gateway - API Key

API Gateway - Configuration