This Python script calculates and plots the monthly costs associated with AWS WAF Only (Web Application Firewall) and AWS Shield Advanced based on the number of requests and data transfer out (DTO). The script considers standard cost for WAF and different pricing tiers for Shield Advanced.
- Python 3.x
- NumPy
- Matplotlib
- Install Python 3.x if you haven't already. You can download it from the official Python website.
- Install the required Python packages using pip:
pip install -r requirements.txt
- Change the value of
AOS(Average Object Size in KB) based on your actual situation. - Run the script using Python:
python main.py
WEBACL_NUM: Number of Web ACLs.RULE_NUM: Number of rules.REQ_PRICE: Cost per million requests for WAF.SUBSC: Monthly subscription fee for Shield Advanced.TIER1_LIMIT,TIER2_LIMIT,TIER3_LIMIT: Limits for Shield pricing tiers in GB.TIER1_PRICE,TIER2_PRICE,TIER3_PRICE,TIER4_PRICE: Prices per GB for Shield Advanced.
All default pricing value is for Amazon CloudFront. You may find more details at AWS WAF Pricing and AWS Shield Pricing.
-
WAF Monthly Fee:
- Calculated as the sum of Web ACL costs, rule costs, and the cost per million requests.
-
Shield Monthly DTO:
- Calculated based on the Average Object Size and the number of requests.
-
Shield Monthly Fee:
- Calculated using different pricing tiers.
- The script plots two lines:
- Red line: Represents WAF cost.
- Blue line: Represents Shield Advanced cost.
- The plot includes a legend and grid for better readability.
- An annotation is added to display the Average Object Size (AOS) on the plot.
The script generates a plot comparing the monthly costs of AWS WAF and AWS Shield Advanced based on the number of requests.
This project is licensed under the MIT License. See the LICENSE file for details.

