Amazon API Gateway integration with AWS WAF

AWS WAF → API Gateway REST API

Create an Amazon API Gateway integration with AWS WAF

This pattern in CDK offers a example to generate an Amazon API Gateway with a greedy proxy ("{proxy+}") and "ANY" method from the specified path.
This means it will accept by default any method and any path. The Lambda function is configured for VPC access and returns only the path.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apig-waf/src

Deploy

npx cdk deploy --app 'ts-node .'


Testing

Locate WAFAPIGatewayApi.ApiUrl from the CDK output. This is the API endpoint to be invoked in a browser.

Cleanup

1. In the source folder, from the command line enter:
npx cdk destroy --app 'ts-node .'
2. Confirm the removal and wait for the resource deletion to complete.

Additional resources

Created by:

Rajneesh Ranjan

Rajneesh Ranjan

Rajneesh works at AWS Professional Services and is a Serverless and Container enthusiast.

Britney Tong

Britney Tong

Britney is an Professional Service and a Serverless enthusiast at Amazon Web Services based in Austin, US. Prior to joining AWS Britney worked in a number of different technical roles specializing in IoT integration, workflow Automation, and Platform as a Service (PaaS).