public RunInstancesRequest withSecurityGroupIds(java.util.Collection<String> securityGroupIds) {
        setSecurityGroupIds(securityGroupIds);
        return this;
    }
<p>
The IDs of the security groups. You can create a security group using <a
href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html"
>CreateSecurityGroup</a>.
</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>

@param securityGroupIds
       The IDs of the security groups. You can create a security group using <a
       href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html"
       >CreateSecurityGroup</a>.</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.
@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