Boto Ec2 和弹性 IP

The*_*net 4 python amazon-ec2 boto

是否可以使用 python boto 将弹性 IP 地址与 ec2 实例相关联?我正在尝试自动化部署。我在 ec2 部分搜索了 api 文档,但一无所获。

use*_*055 5

不知道你在看什么文档,但它在那里:

http://boto.readthedocs.org/en/latest/ref/ec2.html#boto.ec2.address.Address.associate

associate(instance_id=None, network_interface_id=None, private_ip_address=None, allow_reassociation=False, dry_run=False)
Run Code Online (Sandbox Code Playgroud)

将此弹性 IP 地址与当前正在运行的实例相关联。:见: boto.ec2.connection.EC2Connection.associate_address()