Associate a public IP with the network interfaces on our VPC instances.
This commit is contained in:
parent
db8493f254
commit
2215ec6669
1 changed files with 9 additions and 2 deletions
|
@ -117,15 +117,22 @@ class EC2Executor(BuilderExecutor):
|
||||||
)
|
)
|
||||||
block_devices = boto.ec2.blockdevicemapping.BlockDeviceMapping()
|
block_devices = boto.ec2.blockdevicemapping.BlockDeviceMapping()
|
||||||
block_devices['/dev/xvda'] = ssd_root_ebs
|
block_devices['/dev/xvda'] = ssd_root_ebs
|
||||||
|
|
||||||
|
interface = boto.ec2.networkinterface.NetworkInterfaceSpecification(
|
||||||
|
subnet_id=self.executor_config['EC2_VPC_SUBNET_ID'],
|
||||||
|
groups=self.executor_config['EC2_SECURITY_GROUP_IDS'],
|
||||||
|
associate_public_ip_address=True,
|
||||||
|
)
|
||||||
|
interfaces = boto.ec2.networkinterface.NetworkInterfaceCollection(interface)
|
||||||
|
|
||||||
reservation = yield From(ec2_conn.run_instances(
|
reservation = yield From(ec2_conn.run_instances(
|
||||||
coreos_ami,
|
coreos_ami,
|
||||||
instance_type=self.executor_config['EC2_INSTANCE_TYPE'],
|
instance_type=self.executor_config['EC2_INSTANCE_TYPE'],
|
||||||
subnet_id=self.executor_config['EC2_VPC_SUBNET_ID'],
|
|
||||||
security_group_ids=self.executor_config['EC2_SECURITY_GROUP_IDS'],
|
|
||||||
key_name=self.executor_config.get('EC2_KEY_NAME', None),
|
key_name=self.executor_config.get('EC2_KEY_NAME', None),
|
||||||
user_data=user_data,
|
user_data=user_data,
|
||||||
instance_initiated_shutdown_behavior='terminate',
|
instance_initiated_shutdown_behavior='terminate',
|
||||||
block_device_map=block_devices,
|
block_device_map=block_devices,
|
||||||
|
network_interfaces=interfaces,
|
||||||
))
|
))
|
||||||
|
|
||||||
if not reservation.instances:
|
if not reservation.instances:
|
||||||
|
|
Reference in a new issue