/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.AuthorizeSecurityGroupIngressRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AuthorizeSecurityGroupIngressRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest
* The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group.
* To specify an IPv6 address range, use a set of IP permissions.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
*
* If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the type
* number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all ICMP codes.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
*
* The ID of the security group. You must specify either the security group ID or the security group name in the
* request. For security groups in a nondefault VPC, you must specify the security group ID.
*
* [Default VPC] The name of the security group. You must specify either the security group ID or the security group
* name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
*
* The sets of IP permissions.
*
* The IP protocol name (
* Use
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
*
* [Default VPC] The name of the source security group. You can't specify this parameter in combination with the
* following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the
* port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol
* and port range, use a set of IP permissions instead. The source security group must be in the same VPC.
*
* [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group
* is in a different account. You can't specify this parameter in combination with the following parameters: the
* CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules
* that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set
* of IP permissions instead.
*
* If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the code. A
* value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP codes.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
*
* [VPC Only] The tags applied to the security group rule.
*
* The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group.
* To specify an IPv6 address range, use a set of IP permissions.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
* tcp
, udp
, icmp
) or number (see Protocol Numbers). To specify
* icmpv6
, use a set of IP permissions.
* -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of any
* ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public void setCidrIp(String cidrIp) { this.cidrIp = cidrIp; } /** *
* The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group. * To specify an IPv6 address range, use a set of IP permissions. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @return The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source * security group. To specify an IPv6 address range, use a set of IP permissions. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public String getCidrIp() { return this.cidrIp; } /** *
* The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security group. * To specify an IPv6 address range, use a set of IP permissions. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param cidrIp * The IPv4 address range, in CIDR format. You can't specify this parameter when specifying a source security * group. To specify an IPv6 address range, use a set of IP permissions. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withCidrIp(String cidrIp) { setCidrIp(cidrIp); return this; } /** *
* If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the type * number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param fromPort * If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the * type number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all * ICMP codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public void setFromPort(Integer fromPort) { this.fromPort = fromPort; } /** *
* If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the type * number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @return If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the * type number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all * ICMP codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public Integer getFromPort() { return this.fromPort; } /** *
* If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the type * number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param fromPort * If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the * type number. A value of -1 indicates all ICMP types. If you specify all ICMP types, you must specify all * ICMP codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withFromPort(Integer fromPort) { setFromPort(fromPort); return this; } /** *
* The ID of the security group. You must specify either the security group ID or the security group name in the * request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @param groupId * The ID of the security group. You must specify either the security group ID or the security group name in * the request. For security groups in a nondefault VPC, you must specify the security group ID. */ public void setGroupId(String groupId) { this.groupId = groupId; } /** ** The ID of the security group. You must specify either the security group ID or the security group name in the * request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @return The ID of the security group. You must specify either the security group ID or the security group name in * the request. For security groups in a nondefault VPC, you must specify the security group ID. */ public String getGroupId() { return this.groupId; } /** ** The ID of the security group. You must specify either the security group ID or the security group name in the * request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @param groupId * The ID of the security group. You must specify either the security group ID or the security group name in * the request. For security groups in a nondefault VPC, you must specify the security group ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withGroupId(String groupId) { setGroupId(groupId); return this; } /** ** [Default VPC] The name of the security group. You must specify either the security group ID or the security group * name in the request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @param groupName * [Default VPC] The name of the security group. You must specify either the security group ID or the * security group name in the request. For security groups in a nondefault VPC, you must specify the security * group ID. */ public void setGroupName(String groupName) { this.groupName = groupName; } /** ** [Default VPC] The name of the security group. You must specify either the security group ID or the security group * name in the request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @return [Default VPC] The name of the security group. You must specify either the security group ID or the * security group name in the request. For security groups in a nondefault VPC, you must specify the * security group ID. */ public String getGroupName() { return this.groupName; } /** ** [Default VPC] The name of the security group. You must specify either the security group ID or the security group * name in the request. For security groups in a nondefault VPC, you must specify the security group ID. *
* * @param groupName * [Default VPC] The name of the security group. You must specify either the security group ID or the * security group name in the request. For security groups in a nondefault VPC, you must specify the security * group ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withGroupName(String groupName) { setGroupName(groupName); return this; } /** ** The sets of IP permissions. *
* * @return The sets of IP permissions. */ public java.util.List* The sets of IP permissions. *
* * @param ipPermissions * The sets of IP permissions. */ public void setIpPermissions(java.util.Collection* The sets of IP permissions. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setIpPermissions(java.util.Collection)} or {@link #withIpPermissions(java.util.Collection)} if you want * to override the existing values. *
* * @param ipPermissions * The sets of IP permissions. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withIpPermissions(IpPermission... ipPermissions) { if (this.ipPermissions == null) { setIpPermissions(new com.amazonaws.internal.SdkInternalList* The sets of IP permissions. *
* * @param ipPermissions * The sets of IP permissions. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withIpPermissions(java.util.Collection
* The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To specify
* icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of any
* ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param ipProtocol * The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To
* specify icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of
* any ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public void setIpProtocol(String ipProtocol) { this.ipProtocol = ipProtocol; } /** *
* The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To specify
* icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of any
* ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @return The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To
* specify icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of
* any ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public String getIpProtocol() { return this.ipProtocol; } /** *
* The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To specify
* icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of any
* ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param ipProtocol * The IP protocol name (tcp
, udp
, icmp
) or number (see Protocol Numbers). To
* specify icmpv6
, use a set of IP permissions.
*
* Use -1
to specify all protocols. If you specify -1
or a protocol other than
* tcp
, udp
, or icmp
, traffic on all ports is allowed, regardless of
* any ports you specify.
*
* Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withIpProtocol(String ipProtocol) { setIpProtocol(ipProtocol); return this; } /** *
* [Default VPC] The name of the source security group. You can't specify this parameter in combination with the * following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol * and port range, use a set of IP permissions instead. The source security group must be in the same VPC. *
* * @param sourceSecurityGroupName * [Default VPC] The name of the source security group. You can't specify this parameter in combination with * the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the * end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a * specific IP protocol and port range, use a set of IP permissions instead. The source security group must * be in the same VPC. */ public void setSourceSecurityGroupName(String sourceSecurityGroupName) { this.sourceSecurityGroupName = sourceSecurityGroupName; } /** ** [Default VPC] The name of the source security group. You can't specify this parameter in combination with the * following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol * and port range, use a set of IP permissions instead. The source security group must be in the same VPC. *
* * @return [Default VPC] The name of the source security group. You can't specify this parameter in combination with * the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and * the end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with * a specific IP protocol and port range, use a set of IP permissions instead. The source security group * must be in the same VPC. */ public String getSourceSecurityGroupName() { return this.sourceSecurityGroupName; } /** ** [Default VPC] The name of the source security group. You can't specify this parameter in combination with the * following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol * and port range, use a set of IP permissions instead. The source security group must be in the same VPC. *
* * @param sourceSecurityGroupName * [Default VPC] The name of the source security group. You can't specify this parameter in combination with * the following parameters: the CIDR IP address range, the start of the port range, the IP protocol, and the * end of the port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a * specific IP protocol and port range, use a set of IP permissions instead. The source security group must * be in the same VPC. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withSourceSecurityGroupName(String sourceSecurityGroupName) { setSourceSecurityGroupName(sourceSecurityGroupName); return this; } /** ** [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group * is in a different account. You can't specify this parameter in combination with the following parameters: the * CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules * that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set * of IP permissions instead. *
* * @param sourceSecurityGroupOwnerId * [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security * group is in a different account. You can't specify this parameter in combination with the following * parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP * protocol and port range, use a set of IP permissions instead. */ public void setSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) { this.sourceSecurityGroupOwnerId = sourceSecurityGroupOwnerId; } /** ** [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group * is in a different account. You can't specify this parameter in combination with the following parameters: the * CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules * that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set * of IP permissions instead. *
* * @return [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security * group is in a different account. You can't specify this parameter in combination with the following * parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP * protocol and port range, use a set of IP permissions instead. */ public String getSourceSecurityGroupOwnerId() { return this.sourceSecurityGroupOwnerId; } /** ** [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security group * is in a different account. You can't specify this parameter in combination with the following parameters: the * CIDR IP address range, the IP protocol, the start of the port range, and the end of the port range. Creates rules * that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP protocol and port range, use a set * of IP permissions instead. *
* * @param sourceSecurityGroupOwnerId * [Nondefault VPC] The Amazon Web Services account ID for the source security group, if the source security * group is in a different account. You can't specify this parameter in combination with the following * parameters: the CIDR IP address range, the IP protocol, the start of the port range, and the end of the * port range. Creates rules that grant full ICMP, UDP, and TCP access. To create a rule with a specific IP * protocol and port range, use a set of IP permissions instead. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) { setSourceSecurityGroupOwnerId(sourceSecurityGroupOwnerId); return this; } /** ** If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the code. A * value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param toPort * If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the * code. A value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP * codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public void setToPort(Integer toPort) { this.toPort = toPort; } /** *
* If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the code. A * value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @return If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the * code. A value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP * codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. */ public Integer getToPort() { return this.toPort; } /** *
* If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the code. A * value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP codes. *
** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. *
* * @param toPort * If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the * code. A value of -1 indicates all ICMP codes. If you specify all ICMP types, you must specify all ICMP * codes. ** Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withToPort(Integer toPort) { setToPort(toPort); return this; } /** *
* [VPC Only] The tags applied to the security group rule. *
* * @return [VPC Only] The tags applied to the security group rule. */ public java.util.List* [VPC Only] The tags applied to the security group rule. *
* * @param tagSpecifications * [VPC Only] The tags applied to the security group rule. */ public void setTagSpecifications(java.util.Collection* [VPC Only] The tags applied to the security group rule. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if * you want to override the existing values. *
* * @param tagSpecifications * [VPC Only] The tags applied to the security group rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withTagSpecifications(TagSpecification... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList* [VPC Only] The tags applied to the security group rule. *
* * @param tagSpecifications * [VPC Only] The tags applied to the security group rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AuthorizeSecurityGroupIngressRequest withTagSpecifications(java.util.Collection