@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class SecurityGroupRuleRequest extends Object implements Serializable, Cloneable
Describes a security group rule.
You must specify exactly one of the following parameters, based on the rule type:
CidrIpv4
CidrIpv6
PrefixListId
ReferencedGroupId
When you modify a rule, you cannot change the rule type. For example, if the rule uses an IPv4 address range, you
must use CidrIpv4
to specify a new IPv4 address range.
Constructor and Description |
---|
SecurityGroupRuleRequest() |
Modifier and Type | Method and Description |
---|---|
SecurityGroupRuleRequest |
clone() |
boolean |
equals(Object obj) |
String |
getCidrIpv4()
The IPv4 CIDR range.
|
String |
getCidrIpv6()
The IPv6 CIDR range.
|
String |
getDescription()
The description of the security group rule.
|
Integer |
getFromPort()
If the protocol is TCP or UDP, this is the start of the port range.
|
String |
getIpProtocol()
|
String |
getPrefixListId()
The ID of the prefix list.
|
String |
getReferencedGroupId()
The ID of the security group that is referenced in the security group rule.
|
Integer |
getToPort()
If the protocol is TCP or UDP, this is the end of the port range.
|
int |
hashCode() |
void |
setCidrIpv4(String cidrIpv4)
The IPv4 CIDR range.
|
void |
setCidrIpv6(String cidrIpv6)
The IPv6 CIDR range.
|
void |
setDescription(String description)
The description of the security group rule.
|
void |
setFromPort(Integer fromPort)
If the protocol is TCP or UDP, this is the start of the port range.
|
void |
setIpProtocol(String ipProtocol)
|
void |
setPrefixListId(String prefixListId)
The ID of the prefix list.
|
void |
setReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
|
void |
setToPort(Integer toPort)
If the protocol is TCP or UDP, this is the end of the port range.
|
String |
toString()
Returns a string representation of this object.
|
SecurityGroupRuleRequest |
withCidrIpv4(String cidrIpv4)
The IPv4 CIDR range.
|
SecurityGroupRuleRequest |
withCidrIpv6(String cidrIpv6)
The IPv6 CIDR range.
|
SecurityGroupRuleRequest |
withDescription(String description)
The description of the security group rule.
|
SecurityGroupRuleRequest |
withFromPort(Integer fromPort)
If the protocol is TCP or UDP, this is the start of the port range.
|
SecurityGroupRuleRequest |
withIpProtocol(String ipProtocol)
|
SecurityGroupRuleRequest |
withPrefixListId(String prefixListId)
The ID of the prefix list.
|
SecurityGroupRuleRequest |
withReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
|
SecurityGroupRuleRequest |
withToPort(Integer toPort)
If the protocol is TCP or UDP, this is the end of the port range.
|
public void setIpProtocol(String ipProtocol)
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
ipProtocol
- The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public String getIpProtocol()
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public SecurityGroupRuleRequest withIpProtocol(String ipProtocol)
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
ipProtocol
- The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public void setFromPort(Integer fromPort)
If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
fromPort
- If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6,
this is the ICMP type or -1 (all ICMP types).public Integer getFromPort()
If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
public SecurityGroupRuleRequest withFromPort(Integer fromPort)
If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
fromPort
- If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6,
this is the ICMP type or -1 (all ICMP types).public void setToPort(Integer toPort)
If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
toPort
- If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this
is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must
be -1 (all ICMP codes).public Integer getToPort()
If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
public SecurityGroupRuleRequest withToPort(Integer toPort)
If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
toPort
- If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this
is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must
be -1 (all ICMP codes).public void setCidrIpv4(String cidrIpv4)
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
cidrIpv4
- The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.public String getCidrIpv4()
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
public SecurityGroupRuleRequest withCidrIpv4(String cidrIpv4)
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
cidrIpv4
- The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.public void setCidrIpv6(String cidrIpv6)
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
cidrIpv6
- The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.public String getCidrIpv6()
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
public SecurityGroupRuleRequest withCidrIpv6(String cidrIpv6)
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
cidrIpv6
- The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.public void setPrefixListId(String prefixListId)
The ID of the prefix list.
prefixListId
- The ID of the prefix list.public String getPrefixListId()
The ID of the prefix list.
public SecurityGroupRuleRequest withPrefixListId(String prefixListId)
The ID of the prefix list.
prefixListId
- The ID of the prefix list.public void setReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
referencedGroupId
- The ID of the security group that is referenced in the security group rule.public String getReferencedGroupId()
The ID of the security group that is referenced in the security group rule.
public SecurityGroupRuleRequest withReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
referencedGroupId
- The ID of the security group that is referenced in the security group rule.public void setDescription(String description)
The description of the security group rule.
description
- The description of the security group rule.public String getDescription()
The description of the security group rule.
public SecurityGroupRuleRequest withDescription(String description)
The description of the security group rule.
description
- The description of the security group rule.public String toString()
toString
in class Object
Object.toString()
public SecurityGroupRuleRequest clone()