AWS EC2 EIP实用程序。
eiputil的Python项目详细描述
埃普提尔
帮助您操作AWS EC2 eip的工具。在
使用
Usage: eiputil [OPTIONS] COMMAND [ARGS]... Shell completion for click-completion-command Available shell types: bash Bourne again shell fish Friendly interactive shell powershell Windows PowerShell zsh Z shell Default type: auto Options: --help Show this message and exit. Commands: allocate Allocate Elastic IP addresses. describe Describe Elastic IP addresses. install Install the click-completion-command completion. release Release Elastic IP addresses. release-all Release all Elastic IP addresses. show-ipranges Show AWS ip-ranges.
安装单击完成命令完成
安装以使用制表符完成功能。在
^{pr2}$描述弹性IP地址
显示EIP列表。在
$ eiputil describe {"IPAddresses": [{"PublicIp": "192.0.2.1", "InstanceId": "i-0123456789abcdefg", "AllocationId": "eipalloc-1110123456789abcd"}, {"PublicIp": "192.0.2.2", "InstanceId": "", "AllocationId": "eipalloc-2220123456789abcd"}]}
要仅显示与实例无关的地址,请指定–unassigned only选项。在
$ eiputil describe --unassigned-only {"IPAddresses": [{"PublicIp": "192.0.2.2", "InstanceId": "", "AllocationId": "eipalloc-2220123456789abcd"}]}
分配弹性IP地址
分配EIP。在
$ eiputil allocate {"AllocatedIPAddresses": [{"PublicIp": "192.0.2.1", "AllocationId": "eipalloc-1110123456789abcd"}]}
如果要指定多个EIP,请指定多个EIP。在
$ eiputil allocate 3{"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"}]}
指定include选项以仅输出获得的地址中的特定地址。在下面的示例中,仅显示包含175.4.192.0/18和103.4.8.0/21的结果。请注意,它只过滤结果的输出,并实际获得指定数量的地址。在
$ eiputil allocate --include 175.41.192.0/18 --include 103.4.8.0/21 100{"AllocatedIPAddresses": [{"PublicIp": "175.41.221.xx", "AllocationId": "eipalloc-0123456789abcdefg"}]}
释放弹性IP地址
释放EIP。在
$ eiputil release 192.0.2.1 {"ReleasedIPAddresses": [{"PublicIp": "192.0.2.1", "AllocationId": "eipalloc-1110123456789abcd"}]}
如果要释放多个EIP,请连续指定这些EIP。在
$ eiputil release 192.0.2.1 192.0.2.2 {"ReleasedIPAddresses": [{"PublicIp": "192.0.2.1", "AllocationId": "eipalloc-1110123456789abcd"}, {"PublicIp": "192.0.2.2", "AllocationId": "eipalloc-2220123456789abcd"}]}
释放所有弹性IP地址
释放所有未分配的EIP。在
$ eiputil release-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"}]}
显示AWS ip范围
显示AWS ip范围。 (https://ip-ranges.amazonaws.com/ip-ranges.json)
$ eiputil show-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"}]}
- 项目
标签: