AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Returns the public IP address range data for Amazon Web Services. Each address range instance contains the service key, host region and IP address range (in CIDR notation).

Syntax

GetAddressRanges (Default)

Get-AWSPublicIpAddressRange
-ServiceKey <String[]>

ListServiceKeysOnly

Get-AWSPublicIpAddressRange
-OutputServiceKeys <SwitchParameter>

PublicationDate

Get-AWSPublicIpAddressRange
-OutputPublicationDate <SwitchParameter>

Description

Returns the collection of current public IP address ranges for Amazon Web Services. Each address range instance contains the service key, host region and IP address range (in CIDR notation). The cmdlet can optionally emit the set of currently known service keys, perform filtering of output by service key or region information or output the publication date and time of the current information. The information processed by this cmdlet is contained in a publicly accessible JSON-format file at https://ip-ranges.amazonaws.com/ip-ranges.json. The information in this file is generated from our internal system-of-record and is authoritative. You can expect it to change several times per week and should poll accordingly For more details on the public IP address range data for Amazon Web Services, see http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html.

Parameters

-OutputPublicationDate <SwitchParameter>
If set the cmdlet emits the publication date and time of the data.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OutputServiceKeys <SwitchParameter>
If set the cmdlet emits the collection of currently-known service keys used in the address range data.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ServiceKey <String[]>
If set, contains one or more service keys to filter the output to. This parameter can be used in conjunction with the Region parameter to filter by region and service key.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-Region <String[]>
If set, contains one or more region identifiers (e.g. "us-east-1", "global") to filter the output to. This parameter can be used in conjunction with the ServiceKey parameter to filter by region and service key.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Outputs

AWSPublicIpAddressRange
A collection of AWSPublicIpAddressRange instances. This is the default output from the cmdlet.
String[]
A collection of currently-known service keys used in the address data, if the -OutputServiceKeys switch is set.
DateTime
The publication date and time if the -OutputPublicationDate switch is set.

Examples

Example 1

Get-AWSPublicIpAddressRange

IpPrefix Region Service
-------- ------ -------
50.19.0.0/16 us-east-1 AMAZON
54.239.98.0/24 us-east-1 AMAZON
...
50.19.0.0/16 us-east-1 EC2
75.101.128.0/17 us-east-1 EC2
...
205.251.192.0/21 GLOBAL ROUTE53
54.232.40.64/26 sa-east-1 ROUTE53_HEALTHCHECKS
...
54.239.192.0/19 GLOBAL CLOUDFRONT
204.246.176.0/20 GLOBAL CLOUDFRONT
...
Outputs all of the current IP address range objects to the pipeline.

Example 2

Get-AWSPublicIpAddressRange -OutputServiceKeys

AMAZON
EC2
ROUTE53
ROUTE53_HEALTHCHECKS
CLOUDFRONT
Outputs the currently used set of 'Service' keys to the pipeline.

Example 3

Get-AWSPublicIpAddressRange -OutputPublicationDate

Monday, December 15, 2014 4:41:01 PM
Outputs the publication date of the IP address range information.

Example 4

Get-AWSPublicIpAddressRange -ServiceKey ec2
Filters the IP address ranges to output only those with a 'Service' value of 'EC2' to the pipeline.

Example 5

Get-AWSPublicIpAddressRange -Region us-west-2
Filters the IP address ranges to output only those used in the US West (Oregon) region to the pipeline.

Example 6

Get-AWSPublicIpAddressRange -ServiceKey ec2,route53_healthchecks -Region us-west-2
Filters the IP address ranges to output only those belonging to EC2 and CloudFront and in the US West (Oregon) region to the pipeline. Multiple values can also be specified for the -Region parameter.

Supported Version

AWS Tools for PowerShell: 2.x.y.z