AWS IP Ranges Search & Security Group Generator

Perform live queries on official AWS IP ranges. Search reverse IPs, filter by Region or Service, and export rules for Terraform, AWS CLI, and iptables whitelists.

How to Query AWS IP Ranges & Generate Rules

1

Enter IP or Filter Criteria

Enter a target IP address (e.g. 52.216.0.0) to check ownership, or choose specific AWS cloud services and regions from the dropdown selectors.

2

Query & Inspect Results

Click Query AWS IP Ranges. The utility filters the live database, displays matching prefix grids, or outputs the reverse lookup mapping details.

3

Generate whitelists

Select any export tab like Terraform HCL, configure the security group protocol and port, then download or copy rules directly.

Tool Options

Reverse Lookup

Scans the AWS database to instantly identify if any host IP address belongs to AWS, verifying its active region and service mappings.

Terraform & Ingress Export

Generates production-grade IaC security rules with customizable ports, preventing manual ingress calculation errors.

Live AWS Data Sync

Fetches real-time JSON payloads directly from AWS endpoints in client memory, ensuring whitelists are never outdated.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the AWS IP Ranges Search & Security Group Generator do?

The AWS IP Ranges Search & Security Group Generator queries Amazon Web Services' official live IP prefix database (ip-ranges.json). It performs instant reverse lookups on IPv4 addresses to verify AWS ownership, filters active CIDR blocks by AWS service (e.g. CLOUDFRONT, EC2, ROUTE53) and region (e.g. us-east-1, eu-west-1), and compiles rules into Terraform HCL, AWS CLI JSON, or Linux iptables commands.

Core Concepts

Understanding AWS IP range allocation and security group automation:

  • Service & Regional Prefixes: AWS segregates network ranges by regional infrastructure and service boundaries (such as global CloudFront edge points of presence).
  • Reverse IP Lookup: Matches 32-bit IPv4 integers against subnet masks to detect which AWS service and region owns a given IP address.
  • Infrastructure-as-Code Automation: Compiles CIDR lists directly into aws_security_group_rule Terraform blocks or AWS CLI authorize-security-group-ingress calls with custom ports and protocols.

How to use the tool?

  1. Enter IP or Query: Type an IPv4 address to check ownership, or enter a service or region filter.
  2. Filter Options: Select specific AWS services (e.g. CLOUDFRONT, AMAZON, EC2) or AWS regions.
  3. Generate & Export: Choose your output format (List View, Terraform HCL, AWS CLI, iptables), then click Copy to export your ingress whitelist.

Related Developer Utilities

If you work with cloud networking, AWS security, and infrastructure automation, explore these complementary tools:

REST API Integration

Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/aws/aws-ip-ranges) to programmatically filter AWS IP ranges and generate formatted Security Group configurations.

API Request Parameters

Name Type Description Example
query String Search term (IPv4 address, service name, or region code). "54.182.5.5"
filters Object Filtering criteria object (service, region). {"service": "CLOUDFRONT"}
format String Optional output formatting style (json, terraform, aws-cli, iptables). "terraform"
iacOptions Object Optional parameters for security rules (port, protocol, sgName). {"port": 443, "protocol": "tcp"}

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/aws/aws-ip-ranges \
  -H "Content-Type: application/json" \
  -d '{
    "query": "54.182.5.5",
    "filters": { "service": "CLOUDFRONT" }
  }'

Python

import requests

url = "https://blueutils.com/api/aws/aws-ip-ranges"
payload = {
    "query": "54.182.5.5",
    "filters": {"service": "CLOUDFRONT"}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = """
            {
                "query": "54.182.5.5",
                "filters": {
                    "service": "CLOUDFRONT"
                }
            }
            """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/aws/aws-ip-ranges"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether the query was successful. true
type String Type of lookup executed (ip_lookup or list). "ip_lookup"
prefixes Array List of matching prefix objects containing IP, service, and region. [{"ip_prefix": "54.182.0.0/16"}]
outputText String Generated rules script when format parameter is supplied. "resource \"aws_security_group\" ..."

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "type": "ip_lookup",
  "ip": "54.182.5.5",
  "prefixes": [
    {
      "ip_prefix": "54.182.0.0/16",
      "region": "global",
      "service": "CLOUDFRONT",
      "network_border_group": "global"
    }
  ]
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid input: Search IP address or query cannot be empty."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to query AWS IP ranges?

Integrating the AWS IP Ranges API into automated security auditing, edge firewall synchronization, or CI/CD pipelines provides essential benefits:

  • Rapid Script Validation: Automatically synchronizes origin firewall rules whenever AWS updates public CloudFront or Route53 IP addresses.
  • Optimized Token Efficiency for AI Agents: The official ip-ranges.json file is over 4MB in size. Calling the API filters thousands of entries down to the exact matching CIDR list, saving millions of LLM prompt tokens.
  • Deterministic Accuracy Without Hallucinations: Ensures 100% accurate bitwise IP-to-CIDR range matching directly from official AWS datasets.

Native Usage

How to query AWS IP ranges locally in terminal environments or scripts:

Windows (CMD / PowerShell)

# Query CloudFront IPs from AWS official endpoint in PowerShell
(Invoke-RestMethod -Uri https://ip-ranges.amazonaws.com/ip-ranges.json).prefixes | Where-Object { $_.service -eq 'CLOUDFRONT' } | Select-Object -ExpandProperty ip_prefix

Linux / Unix (Bash)

# Query CloudFront IPs using curl and jq in Linux
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="CLOUDFRONT") | .ip_prefix'

Python

Using Python urllib and json:

import urllib.request
import json

url = "https://ip-ranges.amazonaws.com/ip-ranges.json"
with urllib.request.urlopen(url) as response:
    data = json.loads(response.read().decode())

cloudfront_ips = [p["ip_prefix"] for p in data["prefixes"] if p["service"] == "CLOUDFRONT"]
print(cloudfront_ips[:5])

Java

Using Java HttpClient:

import java.net.URI;
import java.net.http.*;

public class AwsIpRangesExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://ip-ranges.amazonaws.com/ip-ranges.json"))
            .GET()
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println("Downloaded AWS IP ranges length: " + response.body().length());
    }
}

Frequently Asked Questions (FAQ)

How do I perform a reverse IP search for AWS?

Paste any suspicious or server IP address into the search input. The tool instantly queries the official AWS ip-ranges.json database to show if the IP belongs to AWS, including its Region and Service (like EC2 or Route53).

Which exports are supported by the whitelisting generator?

You can download or copy configurations formatted as standard AWS Security Group JSON payloads, Terraform ingress rule blocks, AWS CLI JSON specifications, or Linux iptables commands.

Does this utility fetch live AWS IP ranges?

Yes. The tool queries the live, official public endpoint (https://ip-ranges.amazonaws.com/ip-ranges.json) directly from your client browser memory to ensure your whitelist is always up to date.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.