3.2.3 Test with Development Endpoints

Test Applications by Using Development Endpoints

API Gateway Stages

https://api-id.execute-api.region.amazonaws.com/dev/orders
https://api-id.execute-api.region.amazonaws.com/staging/orders
https://api-id.execute-api.region.amazonaws.com/prod/orders

Stage Variables

# Per-stage configuration
dev:
  lambdaAlias: dev
  tableName: orders-dev

prod:
  lambdaAlias: prod
  tableName: orders-prod
  • Access in Lambda: event['stageVariables']['tableName']
  • Access in mapping template: ${stageVariables.lambdaAlias}

Lambda Aliases as Endpoints

arn:aws:lambda:region:account:function:my-func:dev    → $LATEST
arn:aws:lambda:region:account:function:my-func:prod   → Version 5
  • Stable ARN per environment
  • Stage variable → alias mapping

Canary Testing on Stage

  • Route % of traffic to canary deployment
  • Test new version with real traffic
  • Automatic rollback on errors

Exam Tip: API Gateway stages = per-environment endpoints. Stage variables for dynamic config. Lambda aliases for stable function endpoints per environment.