Skip to content

REST API in Amazon API Gateway with Amazon CloudFront Behavior using AWS WAF for API protection

Notifications You must be signed in to change notification settings

oieduardorabelo/cdk-cloudfront-behavior-api-gateway-waf-protection

Repository files navigation

REST API in Amazon API Gateway with Amazon CloudFront Behavior using AWS WAF for API protection

CDK example of:

  • Using multiple behaviors in Amazon CloudFront:
    • Default behavior serving assets from Amazon S3 bucket and an additional behavior serving a REST API from Amazon API Gateway in a custom path
  • Using AWS WAF for API protection:
    • Using AWS WAF to protect the REST API from malicious requests and blocking requests from the internet allowing only CloudFront to access the API with a custom header

Final Architecture:

Extra resources: