Fantastic...here is the code to assign a VPC subnet and a VPC security group to 
help other readers.

template.getOptions().as(AWSEC2TemplateOptions.class).subnetId(subnetId).securityGroupIds(securityGroupId);


And the EC2-classic approach.

template.getOptions().as(AWSEC2TemplateOptions.class).subnetId(subnetId).securityGroups(securityGroupName);


On Sunday, November 24, 2013 9:49 AM, Andrew Phillips <[email protected]> 
wrote:
> I hope the statement above does not mean that it is not possible to  
> designate a VPC and a given Security Group for a given machine  
> instance.

It means that (as per the Amazon docs, too [1]), you cannot assign a  
VPC and a security group *name* ("old-style" security groups) at the  
same time.

You *can*, however, assign a VPC and a security group *ID*  
("VPC-style" security groups).


ap

[1]  
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RunInstances.html,
 look for  
"SecurityGroup.n"

Reply via email to