AWSRunInstancesOptions options = new AWSRunInstancesOptions();
if (launchSpec.getBlockDeviceMappings().size() > 0)
options.withBlockDeviceMappings(launchSpec.getBlockDeviceMappings());
if (launchSpec.getSecurityGroupNames().size() > 0)
options.withSecurityGroups(launchSpec.getSecurityGroupNames());
if (launchSpec.getSecurityGroupIds().size() > 0)
options.withSecurityGroupIds(launchSpec.getSecurityGroupIds());
options.asType(checkNotNull(launchSpec.getInstanceType(), "instanceType"));
if (launchSpec.getSubnetId() != null){
if (Boolean.TRUE.equals(launchSpec.isPublicIpAddressAssociated())) {