docs: add CloudFront WAF example#6323
Conversation
vimtor
left a comment
There was a problem hiding this comment.
thanks for your contribution @Apoorvjain09
i left some comments with errors i found
| export default $config({ | ||
| app(input) { | ||
| return { | ||
| name: "sst-v3", |
There was a problem hiding this comment.
rename this to:
| name: "sst-v3", | |
| name: "aws-cloudfront-waf", |
| const site = new sst.aws.Nextjs("NextjsSite", { | ||
| path: "web/", | ||
| transform: { |
| * | ||
| * The WAF is configured using AWS managed rules and is attached to the | ||
| * CloudFront distribution at creation time. | ||
| * |
|
Thanks for the feedback and for pointing these out 🙂 I’ve updated the example to:
I initially kept the changes limited to |
vimtor
left a comment
There was a problem hiding this comment.
working, i left a final comment @Apoorvjain09
| }); | ||
|
|
||
| const site = new sst.aws.StaticSite("Site", { | ||
| buildOutput: "public", |
There was a problem hiding this comment.
| buildOutput: "public", | |
| path: "public", |
could you create a folder with public/index.html to complete the example?
|
Done 👍 @vimtor Switched to path: "public" and added a minimal public/index.html so the example runs out of the box. |
|
the |
|
Done 👍 @vimtor |
|
we should wait for #6379 |


What this does
Adds an example showing how to associate an AWS WAF Web ACL with a
CloudFront distribution created by
sst.aws.Nextjs.Why this is needed
For CloudFront, WAF must be attached at distribution creation time using
webAclId. This differs from the ALB / API Gateway pattern and was notpreviously documented, making it easy to get wrong.
Closes #6319