WorkHub
This template gives you a clear, hands-on way to block certain IP addresses from accessing your CloudFront content using AWS WAF. It’s perfect for setting up real-time protection against known attackers, bots, or simply restricting traffic from unwanted regions.
The idea is simple: stop malicious or suspicious requests before they get to your backend. With a few clicks and configurations, you’ll have a clean setup that guards your resources without breaking legitimate access.
Stops bad traffic at the edge: You don’t need those requests even hitting your EC2 servers — this blocks them at CloudFront, saving you time and resources.
Better control, stronger security: Whether it’s IPs, countries, or patterns, WAF gives you flexibility in what you block and when.
Works with what you already have: This template integrates smoothly with existing ALBs, EC2s, and VPCs. No big redesign is needed.
Track and validate everything: With CloudTrail and monitoring logs, you can review who tried to get in, what was blocked, and why.
Useful for compliance: Need to show that your systems are protected? This setup is great for audits and internal reviews.
This template is a great fit for:
DevOps engineers or cloud architects looking to tighten their app’s perimeter
Security teams that want to cut off specific IPs or ranges due to abuse or threats
IT admins managing websites, APIs, or apps served via CloudFront
Organizations subject to compliance policies that require strict access controls
You'll want to use this when:
You notice a spike in suspicious activity from a certain IP or range
Your site or app is being targeted by bots or brute-force attempts
You want to lock down access based on IPs while still serving users globally
You’re preparing for or maintaining compliance with security frameworks
Here's what this template includes to help you set things up quickly and securely:
CloudFront – The content delivery network that’s serving your files and assets
AWS WAF – The firewall that filters request and blocks bad IPs before they hit your infrastructure
IP Filtering Rules – A customizable list of IPs (or ranges) to block, built right into WAF
Public Application Load Balancer (ALB) – Handles the routing of incoming external traffic
ALB Security Groups – Acts as a first firewall, protecting your load balancer
EC2 Security Groups – Restricts who can access your web servers
NACLs (Network Access Control Lists) – Adds subnet-level traffic rules for deeper security
IAM Policies – Locks down access to CloudFront and WAF configurations
Monitoring Logs – Keeps track of blocked attempts and access patterns
AWS CloudTrail – Audits and monitors API calls and configuration changes
Traffic Flow Indicators – Helps you visualize how and where requests are getting blocked
Access Restrictions Module – Lets you define region-based or custom logic-based access rules
Here’s how to get started with this template using Cloudairy — the interface that makes it all easier:
Opening the Template in Cloudairy
Sign in to Cloudairy with your credentials.
From the dashboard, go to “Templates.”
Search for “Blocking IP Address at CloudFront.”
Click on the template preview to view the full architecture and settings.
Hit “Open Template” to start editing it as per your needs.
Implementing the IP Blocking
Review the WAF configuration and understand how the rules are structured.
Add or modify IP sets to define which IPs should be blocked or allowed.
Attach the WAF to your CloudFront distribution.
Update ALB and EC2 security groups to match your broader security goals.
Use dependency mapping to double-check that no necessary traffic is being blocked.
Test it! Try accessing it from a blocked IP (you can simulate it) to ensure it’s working.
Monitor logs and export your setup if needed for compliance reports.
The template gives you a strong starting point — you just tailor it to your environment.
At the end of the day, your content and infrastructure deserve to be accessed only by the right people. This Blocking IP Address at CloudFront template is a practical, human-friendly way to make that happen. By combining AWS WAF with CloudFront, ALB, and other built-in security tools, you can create a layered defense against bad actors, bots, and unwanted access.
It’s perfect for DevOps teams, security engineers, and anyone managing cloud applications who wants to keep traffic clean and compliant. And the best part? You don’t have to start from scratch — the hard parts already mapped out for you.
Find templates tailored to your specific needs. Whether you’re designing diagrams, planning projects, or brainstorming ideas, explore related templates to streamline your workflow and inspire creativity
Unlock AI-driven design and teamwork. Start your free trial today
Unlock AI-driven design and teamwork. Start your free trial today