Skip to content

Instantly share code, notes, and snippets.

@beargolightly
Created November 29, 2016 02:05
Show Gist options
  • Select an option

  • Save beargolightly/23c2409e9015997880f5c929de022a1d to your computer and use it in GitHub Desktop.

Select an option

Save beargolightly/23c2409e9015997880f5c929de022a1d to your computer and use it in GitHub Desktop.
Generate Palo Alto object/group creation script from AWS regions/services
#requires the AWS Toolkit for get-awspublicipaddressrange
$iprange = (Get-AWSPublicIpAddressRange -Region us-east-1 -ServiceKey ec2)
$iprange.ipprefix | % {write-host "set address AWS-$($_.Split('/')[0]) ip-netmask $_" ; write-host set address-group AWS_useast_ec2 static AWS-$($_.Split('/')[0]) }
@beargolightly

Copy link
Copy Markdown
Author

I am aware that write-host is literally the worst thing that has happened in history, but I was on a time budget and write-output goes off the deep end with the same syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment