Create an AWS WAF web ACL and attach managed rule groups via the WAFV2 API

domain: docs.aws.amazon.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Determine the scope: use REGIONAL for Application Load Balancers, API Gateway, or AppSync; use CLOUDFRONT for CloudFront distributions (must be created in us-east-1 regardless of distribution region).
  2. Create a web ACL with the create-web-acl CLI command or CreateWebACL API call; provide Name, Scope, DefaultAction (Allow or Block), and VisibilityConfig with CloudWatch metric name and sampling enabled.
  3. Add managed rule groups inside the Rules array using ManagedRuleGroupStatement: set VendorName to AWS for AWS Managed Rules; set Name to the rule group (for example AWSManagedRulesCommonRuleSet or AWSManagedRulesKnownBadInputsRuleSet); set Priority to a unique integer (lower number evaluates first).
  4. Attach the web ACL to your resource with associate-web-acl (for ALB or API Gateway) or by referencing the ACL ARN in your CloudFormation/Terraform template for CloudFront.
  5. Enable AWS WAF logging by creating a Kinesis Data Firehose delivery stream or CloudWatch Log Group and calling PutLoggingConfiguration with the web ACL ARN and the log destination ARN.
  6. Use DescribeManagedRuleGroup to inspect which rules a managed rule group contains and their labels before deploying, so you can add RuleActionOverrides to count (rather than block) specific rules during initial rollout.

Known gotchas

Related routes

Create and manage Cloudflare WAF custom rules via the API
developers.cloudflare.com · 6 steps · unrated
Deploy Cloudflare WAF managed rulesets and configure exceptions via API
developers.cloudflare.com · 6 steps · unrated
Create and deploy a custom Cloudflare WAF rule via the Rulesets API to block a specific attack pattern
developers.cloudflare.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans