Package: eiputil
eiputilA tool to help you operate AWS EC2 EIPs.UsageUsage:eiputil[OPTIONS]COMMAND[ARGS]...Shellcompletionforclick-completion-commandAvailableshelltypes:bashBourneagainshellfishFriendlyinteractiveshellpowershellWindowsPowerShellzshZshellDefaulttype:autoOptions:--helpShowthismessageandexit.Commands:allocateAllocateElasticIPaddresses.describeDescribeElasticIPaddresses.installInstalltheclick-completion-commandcompletion.releaseReleaseElasticIPaddresses.release-allReleaseallElasticIPaddresses.show-iprangesShowAWSip-ranges.Install the click-completion-command completionInstall to use the tab completion function.$eiputilinstallbashbashcompletioninstalledin/home/user/.bash_completionDescribe Elastic IP addresses.Displays a list of EIPs.$eiputildescribe{"IPAddresses":[{"PublicIp":"192.0.2.1","InstanceId":"i-0123456789abcdefg","AllocationId":"eipalloc-1110123456789abcd"},{"PublicIp":"192.0.2.2","InstanceId":"","AllocationId":"eipalloc-2220123456789abcd"}]}To display only addresses that are not associated with an instance, specify the –unassigned-only option.$eiputildescribe--unassigned-only{"IPAddresses":[{"PublicIp":"192.0.2.2","InstanceId":"","AllocationId":"eipalloc-2220123456789abcd"}]}Allocate Elastic IP addresses.Assign an EIP.$eiputilallocate{"AllocatedIPAddresses":[{"PublicIp":"192.0.2.1","AllocationId":"eipalloc-1110123456789abcd"}]}If you want to assign multiple EIPs, specify the number.$eiputilallocate3{"AllocatedIPAddresses":[{"PublicIp":"192.0.2.1","AllocationId":"eipalloc-1110123456789abcd"},{"PublicIp":"192.0.2.2","AllocationId":"eipalloc-2220123456789abcd"},{"PublicIp":"192.0.2.3","AllocationId":"eipalloc-3330123456789abcd"}]}Specify the include option to output only specific addresses among the obtained addresses. In the example below, only results containing 175.4.192.0/18 and 103.4.8.0/21 are displayed. Note that it only filters the output of the result and actually gets the specified number of addresses.$eiputilallocate--include175.41.192.0/18--include103.4.8.0/21100{"AllocatedIPAddresses":[{"PublicIp":"175.41.221.xx","AllocationId":"eipalloc-0123456789abcdefg"}]}Release Elastic IP addresses.Release EIP.$eiputilrelease192.0.2.1{"ReleasedIPAddresses":[{"PublicIp":"192.0.2.1","AllocationId":"eipalloc-1110123456789abcd"}]}If you want to release multiple EIPs, specify the EIPs consecutively.$eiputilrelease192.0.2.1192.0.2.2{"ReleasedIPAddresses":[{"PublicIp":"192.0.2.1","AllocationId":"eipalloc-1110123456789abcd"},{"PublicIp":"192.0.2.2","AllocationId":"eipalloc-2220123456789abcd"}]}Release all Elastic IP addresses.Release all unassigned EIPs.$eiputilrelease-all{"ReleasedIPAddresses":[{"PublicIp":"192.0.2.1","AllocationId":"eipalloc-1110123456789abcd"},{"PublicIp":"192.0.2.2","AllocationId":"eipalloc-2220123456789abcd"},{"PublicIp":"192.0.2.3","AllocationId":"eipalloc-3330123456789abcd"}]}Show AWS ip-ranges.Show AWS ip-ranges.
(https://ip-ranges.amazonaws.com/ip-ranges.json)$eiputilshow-ipranges{"syncToken":"1582935190","createDate":"2020-02-29-00-13-10","prefixes":[{"ip_prefix":"13.248.118.0/24","region":"eu-west-1","service":"AMAZON"},{"ip_prefix":"18.208.0.0/13","region":"us-east-1","service":"AMAZON"},...{"ipv6_prefix":"2600:9000:ddd::/48","region":"GLOBAL","service":"CLOUDFRONT"},{"ipv6_prefix":"2600:9000:5300::/40","region":"GLOBAL","service":"CLOUDFRONT"}]}