Skip to content

Commit

Permalink
add logic to specify eni to aws
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter Morgan committed Dec 5, 2016
1 parent d5b23da commit d657e9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion builtin/providers/aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,13 @@ func buildAwsInstanceOpts(
}
}

if hasSubnet && associatePublicIPAddress {
if v, ok := d.GetOk("network_interface_id"); ok {
ni := &ec2.InstanceNetworkInterfaceSpecification{
DeviceIndex: aws.Int64(int64(0)),
NetworkInterfaceId: aws.String(v.(string)),
}
opts.NetworkInterfaces = []*ec2.InstanceNetworkInterfaceSpecification{ni}
} else if hasSubnet && associatePublicIPAddress {
// If we have a non-default VPC / Subnet specified, we can flag
// AssociatePublicIpAddress to get a Public IP assigned. By default these are not provided.
// You cannot specify both SubnetId and the NetworkInterface.0.* parameters though, otherwise
Expand Down

0 comments on commit d657e9c

Please sign in to comment.