public RunInstancesRequest withSecurityGroups(String... securityGroups) {
        if (this.securityGroups == null) {
            setSecurityGroups(new com.amazonaws.internal.SdkInternalList<String>(securityGroups.length));
        }
        for (String ele : securityGroups) {
            this.securityGroups.add(ele);
        }
        return this;
    }
<p>
[Default VPC] The names of the security groups.
</p>
<p>
If you specify a network interface, you must specify any security groups as part of the network interface instead
of using this parameter.
</p>
<p>
Default: Amazon EC2 uses the default security group.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
to override the existing values.
</p>

@param securityGroups
       [Default VPC] The names of the security groups.</p>
       <p>
       If you specify a network interface, you must specify any security groups as part of the network interface
       instead of using this parameter.
       </p>
       <p>
       Default: Amazon EC2 uses the default security group.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/RunInstancesRequest.java