Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

Amazon API Gateway integration with AWS WAF

Created with SnapAWS WAFAPI Gateway REST APIRequest ANY {proxy+}

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 Visit the GitHub repo for this pattern.

Launch Stack

Download

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

JJ Johnson

Presented by JJ Johnson

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