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 SecurityGroup
clone()
boolean
equals(Object obj)
String
getDescription()
A description of the security group.String
getGroupId()
The ID of the security group.String
getGroupName()
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.String
getOwnerId()
The AWS account ID of the owner of the security group.List<Tag>
getTags()
Any tags assigned to the security group.String
getVpcId()
[EC2-VPC] The ID of the VPC for the security group.int
hashCode()
void
setDescription(String description)
A description of the security group.void
setGroupId(String groupId)
The ID of the security group.void
setGroupName(String groupName)
The name of the security group.void
setIpPermissions(Collection<IpPermission> ipPermissions)
One or more inbound rules associated with the security group.void
setIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.void
setOwnerId(String ownerId)
The AWS account ID of the owner of the security group.void
setTags(Collection<Tag> tags)
Any tags assigned to the security group.void
setVpcId(String vpcId)
[EC2-VPC] The ID of the VPC for the security group.String
toString()
Returns a string representation of this object; useful for testing and debugging.SecurityGroup
withDescription(String description)
A description of the security group.SecurityGroup
withGroupId(String groupId)
The ID of the security group.SecurityGroup
withGroupName(String groupName)
The name of the security group.SecurityGroup
withIpPermissions(IpPermission... ipPermissions)
One or more inbound rules associated with the security group.SecurityGroup
withIpPermissions(Collection<IpPermission> ipPermissions)
One or more inbound rules associated with the security group.SecurityGroup
withIpPermissionsEgress(IpPermission... ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.SecurityGroup
withIpPermissionsEgress(Collection<IpPermission> ipPermissionsEgress)
[EC2-VPC] One or more outbound rules associated with the security group.SecurityGroup
withOwnerId(String ownerId)
The AWS account ID of the owner of the security group.SecurityGroup
withTags(Tag... tags)
Any tags assigned to the security group.SecurityGroup
withTags(Collection<Tag> tags)
Any tags assigned to the security group.SecurityGroup
withVpcId(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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public SecurityGroup clone()
-
-