API Gateway is HTTP/REST API service fronting Lambda, ECS, HTTP endpoints. Handles scaling, throttling, CORS, request/response transformation.
Creating REST API with Lambda integration:
# Create REST API
API_ID=$(aws apigateway create-rest-api \
--name checkout-api \
--description "E-commerce checkout" \
--query 'id' --output text)
# Get root resource
RESOURCE_ID=$(aws apigateway get-resources \
--rest-api-id $API_ID \
--query 'items[0].id' --output text)
# Create /orders resource
ORDERS_RESOURCE=$(aws apigateway create-resource \
--rest-api-id $API_ID \
--parent-id