Your organization concerns are your partner’s use of web crawlers and the crawlers staying under rate-limiting rules. You are asked to setup an alerting system to notify you if the PHP crawler usage exceeds an specified threshold.
First, we are going to create an SNS topic with no subscriber (there’s no need for setting up the email notification). Then, we’ll create a CloudWatch alarm to track the phpcrawl-rate-limiter rule. The alarm is triggered if any request is consistently blocked for 1 minute.
Verify your configuration by triggering rate limiting. The script’s excessive request should trigger the alarm (change the alarm state).
Note: You may see an error message referencing KMS permissions. You can safely ignore it as we do not use at-rest encryption features of SNS in this lab.
Find and navigate to Simple Notification Service (SNS) in the AWS console
Under Create topic, enter the name waf-alerts, then click Next step
Under Details, fill the following information in the blanks:

Navigate to CloudWatch service in the AWS Console
Navigate to Alarms, All alarms
Click on Create alarm

5. Navigate to WAFV2, Region, Rule, WebACL







This procedure will generate a large number of requests that will be recorded as Cloudwatch metrics, which will trigger the WAF rule for rate-limit. As the number of requests exceeds the limit, the alarm should be triggered
Trigger the alarm

Verify in CloudWatch
It may take several minutes before the CloudWatch Alarms state changes into “In Alarm” from “Insufficient data”.
Navigate to CloudWatch service in the AWS Console
Click In alarm to view triggerred alarms
You should see the alarm you just created (Note: it may take 1-2 minutes for the transition to in-alarm state)
Click phpcrawl-alarm to get more details with a chart

Congratulations! Your AWS WAF rule monitoring alarm has been successfully created. You’ll surely be notified whenever the rule is triggered.