com.amazonaws.services.ec2.model
Class CreateSecurityGroupRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateSecurityGroupRequest
All Implemented Interfaces:
DryRunSupportedRequest<CreateSecurityGroupRequest>, java.io.Serializable

public class CreateSecurityGroupRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<CreateSecurityGroupRequest>

Container for the parameters to the CreateSecurityGroup operation.

Creates a security group.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

IMPORTANT: EC2-Classic: You can have up to 500 security groups. EC2-VPC: You can create up to 100 security groups per VPC.

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.

See Also:
AmazonEC2.createSecurityGroup(CreateSecurityGroupRequest), Serialized Form

Constructor Summary
CreateSecurityGroupRequest()
          Default constructor for a new CreateSecurityGroupRequest object.
CreateSecurityGroupRequest(java.lang.String groupName, java.lang.String description)
          Constructs a new CreateSecurityGroupRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDescription()
          A description for the security group.
 Request<CreateSecurityGroupRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getGroupName()
          The name of the security group.
 java.lang.String getVpcId()
          [EC2-VPC] The ID of the VPC.
 int hashCode()
           
 void setDescription(java.lang.String description)
          A description for the security group.
 void setGroupName(java.lang.String groupName)
          The name of the security group.
 void setVpcId(java.lang.String vpcId)
          [EC2-VPC] The ID of the VPC.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateSecurityGroupRequest withDescription(java.lang.String description)
          A description for the security group.
 CreateSecurityGroupRequest withGroupName(java.lang.String groupName)
          The name of the security group.
 CreateSecurityGroupRequest withVpcId(java.lang.String vpcId)
          [EC2-VPC] The ID of the VPC.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateSecurityGroupRequest

public CreateSecurityGroupRequest()
Default constructor for a new CreateSecurityGroupRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


CreateSecurityGroupRequest

public CreateSecurityGroupRequest(java.lang.String groupName,
                                  java.lang.String description)
Constructs a new CreateSecurityGroupRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
groupName - The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

description - A description for the security group. This is informational only.
Method Detail

getGroupName

public java.lang.String getGroupName()
The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Returns:
The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*


setGroupName

public void setGroupName(java.lang.String groupName)
The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Parameters:
groupName - The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*


withGroupName

public CreateSecurityGroupRequest withGroupName(java.lang.String groupName)
The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Returns a reference to this object so that method calls can be chained together.

Parameters:
groupName - The name of the security group.

Constraints: Up to 255 characters in length

Constraints for EC2-Classic: ASCII characters

Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

Returns:
A reference to this updated object so that method calls can be chained together.

getDescription

public java.lang.String getDescription()
A description for the security group. This is informational only.

Returns:
A description for the security group. This is informational only.

setDescription

public void setDescription(java.lang.String description)
A description for the security group. This is informational only.

Parameters:
description - A description for the security group. This is informational only.

withDescription

public CreateSecurityGroupRequest withDescription(java.lang.String description)
A description for the security group. This is informational only.

Returns a reference to this object so that method calls can be chained together.

Parameters:
description - A description for the security group. This is informational only.
Returns:
A reference to this updated object so that method calls can be chained together.

getVpcId

public java.lang.String getVpcId()
[EC2-VPC] The ID of the VPC.

Returns:
[EC2-VPC] The ID of the VPC.

setVpcId

public void setVpcId(java.lang.String vpcId)
[EC2-VPC] The ID of the VPC.

Parameters:
vpcId - [EC2-VPC] The ID of the VPC.

withVpcId

public CreateSecurityGroupRequest withVpcId(java.lang.String vpcId)
[EC2-VPC] The ID of the VPC.

Returns a reference to this object so that method calls can be chained together.

Parameters:
vpcId - [EC2-VPC] The ID of the VPC.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<CreateSecurityGroupRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<CreateSecurityGroupRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.