AWS
The cipr aws command retrieves IP ranges for Amazon Web Services (AWS).
Usage
cipr aws [flags]
Data Format
See the AWS command data format for output fields and filter-value guidance.
Flags
| Flag | Description | Default | Required | Multiple values |
|---|---|---|---|---|
--ipv4 | Get only IPv4 ranges. | ❌ | ❌ | ❌ |
--ipv6 | Get only IPv6 ranges. | ❌ | ❌ | ❌ |
--filter | Filter results using a single string. Syntax: region,service,network-border-group. | ❌ | ❌ | ❌ |
--filter-region | Filter results by AWS region. | ❌ | ❌ | ✅ |
--filter-service | Filter results by AWS service. | ❌ | ❌ | ✅ |
--filter-network-border-group | Filter results by AWS network border group. | ❌ | ❌ | ✅ |
--list | List unique values for a dimension instead of IP ranges. Valid: regions, services, network-border-groups. | ❌ | ❌ | ❌ |
The individual filter flags accept comma-separated values. Values within one flag use OR matching, while separate filter flags use AND matching. For example, --filter-region eu-west-1,eu-central-1 --filter-service S3,EC2 selects S3 or EC2 ranges in either region.
--filter keeps its region,service,network-border-group syntax and cannot be combined with --filter-region, --filter-service, or --filter-network-border-group. When neither --ipv4 nor --ipv6 is set, both are fetched. --list composes with the --filter* flags but ignores --ipv4/--ipv6.
Source and caching
The configured source key is aws, with these default settings:
aws_endpoint = "https://ip-ranges.amazonaws.com/ip-ranges.json"
aws_local_file = ""
aws_cache_ttl = "24h"
Use cipr configure aws to inspect the effective values. Custom URLs and local files supplied through --source must use the same JSON schema as ip-ranges.json.
AWS updates the feed when its IP ranges change. Use --no-cache when a run must fetch the current publication instead of a valid cached response.
Examples
IP ranges in the output examples are snapshots and might not be current.
Get all AWS IPv4 ranges
cipr aws --ipv4
...
35.71.111.0/24
52.94.13.0/24
52.94.7.0/24
...
Get AWS IPv6 ranges for the eu-west-1 region with mini verbosity
cipr aws --ipv6 --filter-region eu-west-1 --verbose-mode mini
...
2a05:d076:8000::/40,eu-west-1,AMAZON,eu-west-1
2600:1f01:4802::/47,eu-west-1,AMAZON,eu-west-1
2606:f40:1000::/39,eu-west-1,AMAZON,eu-west-1
2a05:d031:8000::/40,eu-west-1,AMAZON,eu-west-1
2a01:578:0:7000::/56,eu-west-1,AMAZON,eu-west-1
...
Get S3 or EC2 ranges in either eu-west-1 or eu-central-1
cipr aws --filter-region eu-west-1,eu-central-1 --filter-service S3,EC2
Get all AWS IP ranges for the EC2 service in the us-east-1 with full verbosity
cipr aws --filter us-east-1,ec2 --verbose
...
IP Prefix: 3.3.2.0/24, Region: us-east-1, Service: EC2, Network Border Group: us-east-1
IP Prefix: 96.0.48.0/21, Region: us-east-1, Service: EC2, Network Border Group: us-east-1-scl-1
IP Prefix: 2600:f0f0:2::/48, Region: us-east-1, Service: EC2, Network Border Group: us-east-1
IP Prefix: 2605:9cc0:1ff0:500::/56, Region: us-east-1, Service: EC2, Network Border Group: us-east-1
IP Prefix: 2600:1f19:8000::/36, Region: us-east-1, Service: EC2, Network Border Group: us-east-1
...
List all AWS regions
cipr aws --list regions
...
ap-northeast-1
ap-southeast-1
eu-central-1
eu-west-1
us-east-1
us-west-2
...
List AWS services available in eu-central-1
cipr aws --filter-region eu-central-1 --list services
...
AMAZON
EC2
ROUTE53_HEALTHCHECKS
S3
...