Skip to content
Permalink
Browse files

Fix instance launch on EC2 Classic

  • Loading branch information...
cristim committed Nov 2, 2016
1 parent a31714d commit 1e189a2256edcfe5800059f6a039d9f4efcdd47a
Showing with 13 additions and 7 deletions.
  1. +13 −7 core/autoscaling.go
@@ -533,13 +533,19 @@ func convertLaunchConfigurationToSpotSpecification(
}
}

spotLS.NetworkInterfaces = []*ec2.InstanceNetworkInterfaceSpecification{
&ec2.InstanceNetworkInterfaceSpecification{
AssociatePublicIpAddress: lc.AssociatePublicIpAddress,
DeviceIndex: aws.Int64(0),
SubnetId: baseInstance.SubnetId,
Groups: lc.SecurityGroups,
},
if lc.AssociatePublicIpAddress != nil || baseInstance.SubnetId != nil {
// Instances are running in a VPC.
spotLS.NetworkInterfaces = []*ec2.InstanceNetworkInterfaceSpecification{
&ec2.InstanceNetworkInterfaceSpecification{
AssociatePublicIpAddress: lc.AssociatePublicIpAddress,
DeviceIndex: aws.Int64(0),
SubnetId: baseInstance.SubnetId,
Groups: lc.SecurityGroups,
},
}
} else {
// Instances are running in EC2 Classic.
spotLS.SecurityGroups = lc.SecurityGroups
}

if lc.UserData != nil && *lc.UserData != "" {

0 comments on commit 1e189a2

Please sign in to comment.
You can’t perform that action at this time.