Class SecurityGroup
- java.lang.Object
-
- com.amazonaws.services.ec2.model.SecurityGroup
-
- All Implemented Interfaces:
Serializable,Cloneable
public class SecurityGroup extends Object implements Serializable, Cloneable
Describes a security group
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SecurityGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityGroupclone()booleanequals(Object obj)StringgetDescription()A description of the security group.StringgetGroupId()The ID of the security group.StringgetGroupName()The name of the security group.List<IpPermission>getIpPermissions()One or more inbound rules associated with the security group.List<IpPermission>getIpPermissionsEgress()[EC2-VPC] One or more outbound rules associated with the security group.StringgetOwnerId()The AWS account ID of the owner of the security group.List<Tag>getTags()Any tags assigned to the security group.StringgetVpcId()[EC2-VPC] The ID of the VPC for the security group.inthashCode()voidsetDescription(String description)A description of the security group.voidsetGroupId(String groupId)The ID of the security group.voidsetGroupName(String groupName)The name of the security group.voidsetIpPermissions(Collection<IpPermission> ipPermissions)One or more inbound rules associated with the security group.voidsetIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)[EC2-VPC] One or more outbound rules associated with the security group.voidsetOwnerId(String ownerId)The AWS account ID of the owner of the security group.voidsetTags(Collection<Tag> tags)Any tags assigned to the security group.voidsetVpcId(String vpcId)[EC2-VPC] The ID of the VPC for the security group.StringtoString()Returns a string representation of this object; useful for testing and debugging.SecurityGroupwithDescription(String description)A description of the security group.SecurityGroupwithGroupId(String groupId)The ID of the security group.SecurityGroupwithGroupName(String groupName)The name of the security group.SecurityGroupwithIpPermissions(IpPermission... ipPermissions)One or more inbound rules associated with the security group.SecurityGroupwithIpPermissions(Collection<IpPermission> ipPermissions)One or more inbound rules associated with the security group.SecurityGroupwithIpPermissionsEgress(IpPermission... ipPermissionsEgress)[EC2-VPC] One or more outbound rules associated with the security group.SecurityGroupwithIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)[EC2-VPC] One or more outbound rules associated with the security group.SecurityGroupwithOwnerId(String ownerId)The AWS account ID of the owner of the security group.SecurityGroupwithTags(Tag... tags)Any tags assigned to the security group.SecurityGroupwithTags(Collection<Tag> tags)Any tags assigned to the security group.SecurityGroupwithVpcId(String vpcId)[EC2-VPC] The ID of the VPC for the security group.
-
-
-
Method Detail
-
setOwnerId
public void setOwnerId(String ownerId)
The AWS account ID of the owner of the security group.
- Parameters:
ownerId- The AWS account ID of the owner of the security group.
-
getOwnerId
public String getOwnerId()
The AWS account ID of the owner of the security group.
- Returns:
- The AWS account ID of the owner of the security group.
-
withOwnerId
public SecurityGroup withOwnerId(String ownerId)
The AWS account ID of the owner of the security group.
- Parameters:
ownerId- The AWS account ID of the owner of the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setGroupName
public void setGroupName(String groupName)
The name of the security group.
- Parameters:
groupName- The name of the security group.
-
getGroupName
public String getGroupName()
The name of the security group.
- Returns:
- The name of the security group.
-
withGroupName
public SecurityGroup withGroupName(String groupName)
The name of the security group.
- Parameters:
groupName- The name of the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setGroupId
public void setGroupId(String groupId)
The ID of the security group.
- Parameters:
groupId- The ID of the security group.
-
getGroupId
public String getGroupId()
The ID of the security group.
- Returns:
- The ID of the security group.
-
withGroupId
public SecurityGroup withGroupId(String groupId)
The ID of the security group.
- Parameters:
groupId- The ID of the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDescription
public void setDescription(String description)
A description of the security group.
- Parameters:
description- A description of the security group.
-
getDescription
public String getDescription()
A description of the security group.
- Returns:
- A description of the security group.
-
withDescription
public SecurityGroup withDescription(String description)
A description of the security group.
- Parameters:
description- A description of the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getIpPermissions
public List<IpPermission> getIpPermissions()
One or more inbound rules associated with the security group.
- Returns:
- One or more inbound rules associated with the security group.
-
setIpPermissions
public void setIpPermissions(Collection<IpPermission> ipPermissions)
One or more inbound rules associated with the security group.
- Parameters:
ipPermissions- One or more inbound rules associated with the security group.
-
withIpPermissions
public SecurityGroup withIpPermissions(IpPermission... ipPermissions)
One or more inbound rules associated with the security group.
NOTE: This method appends the values to the existing list (if any). Use
setIpPermissions(java.util.Collection)orwithIpPermissions(java.util.Collection)if you want to override the existing values.- Parameters:
ipPermissions- One or more inbound rules associated with the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withIpPermissions
public SecurityGroup withIpPermissions(Collection<IpPermission> ipPermissions)
One or more inbound rules associated with the security group.
- Parameters:
ipPermissions- One or more inbound rules associated with the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getIpPermissionsEgress
public List<IpPermission> getIpPermissionsEgress()
[EC2-VPC] One or more outbound rules associated with the security group.
- Returns:
- [EC2-VPC] One or more outbound rules associated with the security group.
-
setIpPermissionsEgress
public void setIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.
- Parameters:
ipPermissionsEgress- [EC2-VPC] One or more outbound rules associated with the security group.
-
withIpPermissionsEgress
public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.
NOTE: This method appends the values to the existing list (if any). Use
setIpPermissionsEgress(java.util.Collection)orwithIpPermissionsEgress(java.util.Collection)if you want to override the existing values.- Parameters:
ipPermissionsEgress- [EC2-VPC] One or more outbound rules associated with the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withIpPermissionsEgress
public SecurityGroup withIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.
- Parameters:
ipPermissionsEgress- [EC2-VPC] One or more outbound rules associated with the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setVpcId
public void setVpcId(String vpcId)
[EC2-VPC] The ID of the VPC for the security group.
- Parameters:
vpcId- [EC2-VPC] The ID of the VPC for the security group.
-
getVpcId
public String getVpcId()
[EC2-VPC] The ID of the VPC for the security group.
- Returns:
- [EC2-VPC] The ID of the VPC for the security group.
-
withVpcId
public SecurityGroup withVpcId(String vpcId)
[EC2-VPC] The ID of the VPC for the security group.
- Parameters:
vpcId- [EC2-VPC] The ID of the VPC for the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getTags
public List<Tag> getTags()
Any tags assigned to the security group.
- Returns:
- Any tags assigned to the security group.
-
setTags
public void setTags(Collection<Tag> tags)
Any tags assigned to the security group.
- Parameters:
tags- Any tags assigned to the security group.
-
withTags
public SecurityGroup withTags(Tag... tags)
Any tags assigned to the security group.
NOTE: This method appends the values to the existing list (if any). Use
setTags(java.util.Collection)orwithTags(java.util.Collection)if you want to override the existing values.- Parameters:
tags- Any tags assigned to the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withTags
public SecurityGroup withTags(Collection<Tag> tags)
Any tags assigned to the security group.
- Parameters:
tags- Any tags assigned to the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public SecurityGroup clone()
-
-