【发布时间】:2017-02-07 00:06:51
【问题描述】:
我正在尝试使用 python boto 自动部署 aws VPN [IPSec] 实例。我正在使用“ec2.run_instances”启动新实例。
reservations = ec2.run_instances(
image_id,
subnet_id=subnet_id,
instance_type=instance_type,
instance_initiated_shutdown_behavior='stop',
key_name=key_name,
security_group_ids=[security_group])
为了使该脚本正常工作,我需要为此实例禁用源/目标检查。我找不到使用 python boto 禁用它的方法。根据 boto 文档,我可以使用“modify_instance_attribute”来做到这一点。
http://boto.likedoc.net/en/latest/ref/ec2.html
但是我找不到任何使用此属性的示例脚本。请给我一些例子,以便我完成这个。
提前致谢。
【问题讨论】:
-
ec2 = boto.ec2.connection.EC2Connection(region=regon) ec2.modify_instance_attribute(instance.id, 'sourceDestCheck', 'false', dry_run=False)
-
上面给出的代码对我有用
标签: boto