@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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 codes.
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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6
types, you must specify all ICMP/ICMPv6 codes.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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 codes.
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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 codes.
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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6
types, you must specify all ICMP/ICMPv6 codes.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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must
specify all ICMP/ICMPv6 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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must
specify all ICMP/ICMPv6 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()