1. Install the AWS Tools for PowerShell package option that's appropriate for your environment.
  2. Verify that script execution is enabled by running the Get-ExecutionPolicy cmdlet.
  3. Import the AWS Tools for PowerShell module into your PowerShell session.

 

To install AWS.Tools on Windows using the AWS.Tools.Installer module

  • Start a PowerShell session.

 

 

  • To install the modularized AWS.Tools package, run the following command. (Install-Module -Name AWS.Tools.Installer)

  • Once you have downloaded the AWS Tool for PowerShell now you can use this for querying the IP ranges for specific AWS service with Specific region.
  • For querying the IP ranges follow the following steps
  • Run the command (Get-AWSPublicIpAddressRange) in PowerShell 

  • By running this command, you will get all the Ip ranges for all the services and in all the region. 

 

  • Now to filter out specific AWS service with specific region. Run the following command (Get-AWSPublicIpAddressRange -ServiceKey SERVICENAME -Region REGIONNAME)
  • Ps. Replace SERVICENAME and the REGIONNAME with the service and the region you want to filter out with 

  • You can also save the output as a text file on your device with the following command (Get-AWSPublicIpAddressRange -ServiceKey ec2 | Out-File -FilePath "C:\Users\Owner\Documents\S3IPAddressRange.txt")