Skip to main content

AWS

The cipr aws command retrieves IP ranges for Amazon Web Services (AWS).

Usage

CLI command
cipr aws [flags]

Data Format

See the AWS command data format for output fields and filter-value guidance.

Flags

FlagDescriptionDefaultRequiredMultiple values
--ipv4Get only IPv4 ranges.
--ipv6Get only IPv6 ranges.
--filterFilter results using a single string. Syntax: region,service,network-border-group.
--filter-regionFilter results by AWS region.
--filter-serviceFilter results by AWS service.
--filter-network-border-groupFilter results by AWS network border group.
--listList 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

tip

IP ranges in the output examples are snapshots and might not be current.

Get all AWS IPv4 ranges

CLI command
cipr aws --ipv4
Output
...
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

CLI command
cipr aws --ipv6 --filter-region eu-west-1 --verbose-mode mini
Output
...
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

CLI command
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

CLI command
cipr aws --filter us-east-1,ec2 --verbose
Output
...
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

CLI command
cipr aws --list regions
Output
...
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

CLI command
cipr aws --filter-region eu-central-1 --list services
Output
...
AMAZON
EC2
ROUTE53_HEALTHCHECKS
S3
...