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:
  • Constructor Details

    • SecurityGroup

      public SecurityGroup()
  • Method Details

    • 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) or withIpPermissions(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) or withIpPermissionsEgress(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) or withTags(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 class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public SecurityGroup clone()
      Overrides:
      clone in class Object