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 SAM provides a means to generate a WebACL and associate it with an existing REST or Websocket API (HTTP APIs are not currently supported).

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Launch Stack

Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-waf-sam

Deploy

sam buildsam deploy --guided


Testing

Invoke the API with the appropriate stage. To view the WebACL rules, visit the Management Console and navigate to the WAF & Shield service page.

Cleanup

1. Delete the stack: cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".

Additional resources

Created by:

JJ Johnson

JJ Johnson

JJ is a Cloud Application Architect who works in the US.