Class IpPermission

java.lang.Object
com.amazonaws.services.ec2.model.IpPermission
All Implemented Interfaces:
Serializable, Cloneable

public class IpPermission extends Object implements Serializable, Cloneable

Describes a security group rule.

See Also:
  • Constructor Details

    • IpPermission

      public IpPermission()
  • Method Details

    • setIpProtocol

      public void setIpProtocol(String ipProtocol)

      The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

      Parameters:
      ipProtocol - The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

    • getIpProtocol

      public String getIpProtocol()

      The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

      Returns:
      The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

    • withIpProtocol

      public IpPermission withIpProtocol(String ipProtocol)

      The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

      Parameters:
      ipProtocol - The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers).

      [EC2-VPC only] When you authorize or revoke security group rules, you can use -1 to specify all.

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

      public void setFromPort(Integer fromPort)

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

      Parameters:
      fromPort - The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
    • getFromPort

      public Integer getFromPort()

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

      Returns:
      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
    • withFromPort

      public IpPermission withFromPort(Integer fromPort)

      The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

      Parameters:
      fromPort - The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setToPort

      public void setToPort(Integer toPort)

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

      Parameters:
      toPort - The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.
    • getToPort

      public Integer getToPort()

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

      Returns:
      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.
    • withToPort

      public IpPermission withToPort(Integer toPort)

      The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

      Parameters:
      toPort - The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getUserIdGroupPairs

      public List<UserIdGroupPair> getUserIdGroupPairs()

      One or more security group and AWS account ID pairs.

      Returns:
      One or more security group and AWS account ID pairs.
    • setUserIdGroupPairs

      public void setUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)

      One or more security group and AWS account ID pairs.

      Parameters:
      userIdGroupPairs - One or more security group and AWS account ID pairs.
    • withUserIdGroupPairs

      public IpPermission withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs)

      One or more security group and AWS account ID pairs.

      NOTE: This method appends the values to the existing list (if any). Use setUserIdGroupPairs(java.util.Collection) or withUserIdGroupPairs(java.util.Collection) if you want to override the existing values.

      Parameters:
      userIdGroupPairs - One or more security group and AWS account ID pairs.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • withUserIdGroupPairs

      public IpPermission withUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)

      One or more security group and AWS account ID pairs.

      Parameters:
      userIdGroupPairs - One or more security group and AWS account ID pairs.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getIpRanges

      public List<String> getIpRanges()

      One or more IP ranges.

      Returns:
      One or more IP ranges.
    • setIpRanges

      public void setIpRanges(Collection<String> ipRanges)

      One or more IP ranges.

      Parameters:
      ipRanges - One or more IP ranges.
    • withIpRanges

      public IpPermission withIpRanges(String... ipRanges)

      One or more IP ranges.

      NOTE: This method appends the values to the existing list (if any). Use setIpRanges(java.util.Collection) or withIpRanges(java.util.Collection) if you want to override the existing values.

      Parameters:
      ipRanges - One or more IP ranges.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • withIpRanges

      public IpPermission withIpRanges(Collection<String> ipRanges)

      One or more IP ranges.

      Parameters:
      ipRanges - One or more IP ranges.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getPrefixListIds

      public List<PrefixListId> getPrefixListIds()

      (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

      Returns:
      (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
    • setPrefixListIds

      public void setPrefixListIds(Collection<PrefixListId> prefixListIds)

      (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

      Parameters:
      prefixListIds - (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
    • withPrefixListIds

      public IpPermission withPrefixListIds(PrefixListId... prefixListIds)

      (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

      NOTE: This method appends the values to the existing list (if any). Use setPrefixListIds(java.util.Collection) or withPrefixListIds(java.util.Collection) if you want to override the existing values.

      Parameters:
      prefixListIds - (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • withPrefixListIds

      public IpPermission withPrefixListIds(Collection<PrefixListId> prefixListIds)

      (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.

      Parameters:
      prefixListIds - (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with 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 IpPermission clone()
      Overrides:
      clone in class Object