/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include An IP permission for an EC2 security group.See Also:
AWS
* API Reference
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The IP protocol name (tcp
, udp
, icmp
,
* icmpv6
) or number.
[VPC only] Use -1
to specify
* all protocols.
When authorizing security group rules, specifying
* -1
or a protocol number other than tcp
,
* udp
, icmp
, or icmpv6
allows traffic on
* all ports, regardless of any port range you specify.
For
* tcp
, udp
, and icmp
, you must specify a
* port range.
For icmpv6
, the port range is optional. If you
* omit the port range, traffic for all types and codes is allowed.
The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you * specify all ICMP/ICMPv6 types, you must specify all codes.
*/ inline int GetFromPort() const{ return m_fromPort; } /** *The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you * specify all ICMP/ICMPv6 types, you must specify all codes.
*/ inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; } /** *The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you * specify all ICMP/ICMPv6 types, you must specify all codes.
*/ inline void SetFromPort(int value) { m_fromPortHasBeenSet = true; m_fromPort = value; } /** *The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you * specify all ICMP/ICMPv6 types, you must specify all codes.
*/ inline AwsEc2SecurityGroupIpPermission& WithFromPort(int value) { SetFromPort(value); return *this;} /** *The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you
* specify all ICMP/ICMPv6 types, you must specify all codes.
The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you
* specify all ICMP/ICMPv6 types, you must specify all codes.
The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you
* specify all ICMP/ICMPv6 types, you must specify all codes.
The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 * code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you
* specify all ICMP/ICMPv6 types, you must specify all codes.
The security group and Amazon Web Services account ID pairs.
*/ inline const Aws::VectorThe security group and Amazon Web Services account ID pairs.
*/ inline bool UserIdGroupPairsHasBeenSet() const { return m_userIdGroupPairsHasBeenSet; } /** *The security group and Amazon Web Services account ID pairs.
*/ inline void SetUserIdGroupPairs(const Aws::VectorThe security group and Amazon Web Services account ID pairs.
*/ inline void SetUserIdGroupPairs(Aws::VectorThe security group and Amazon Web Services account ID pairs.
*/ inline AwsEc2SecurityGroupIpPermission& WithUserIdGroupPairs(const Aws::VectorThe security group and Amazon Web Services account ID pairs.
*/ inline AwsEc2SecurityGroupIpPermission& WithUserIdGroupPairs(Aws::VectorThe security group and Amazon Web Services account ID pairs.
*/ inline AwsEc2SecurityGroupIpPermission& AddUserIdGroupPairs(const AwsEc2SecurityGroupUserIdGroupPair& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs.push_back(value); return *this; } /** *The security group and Amazon Web Services account ID pairs.
*/ inline AwsEc2SecurityGroupIpPermission& AddUserIdGroupPairs(AwsEc2SecurityGroupUserIdGroupPair&& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs.push_back(std::move(value)); return *this; } /** *The IPv4 ranges.
*/ inline const Aws::VectorThe IPv4 ranges.
*/ inline bool IpRangesHasBeenSet() const { return m_ipRangesHasBeenSet; } /** *The IPv4 ranges.
*/ inline void SetIpRanges(const Aws::VectorThe IPv4 ranges.
*/ inline void SetIpRanges(Aws::VectorThe IPv4 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& WithIpRanges(const Aws::VectorThe IPv4 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& WithIpRanges(Aws::VectorThe IPv4 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& AddIpRanges(const AwsEc2SecurityGroupIpRange& value) { m_ipRangesHasBeenSet = true; m_ipRanges.push_back(value); return *this; } /** *The IPv4 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& AddIpRanges(AwsEc2SecurityGroupIpRange&& value) { m_ipRangesHasBeenSet = true; m_ipRanges.push_back(std::move(value)); return *this; } /** *The IPv6 ranges.
*/ inline const Aws::VectorThe IPv6 ranges.
*/ inline bool Ipv6RangesHasBeenSet() const { return m_ipv6RangesHasBeenSet; } /** *The IPv6 ranges.
*/ inline void SetIpv6Ranges(const Aws::VectorThe IPv6 ranges.
*/ inline void SetIpv6Ranges(Aws::VectorThe IPv6 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& WithIpv6Ranges(const Aws::VectorThe IPv6 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& WithIpv6Ranges(Aws::VectorThe IPv6 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& AddIpv6Ranges(const AwsEc2SecurityGroupIpv6Range& value) { m_ipv6RangesHasBeenSet = true; m_ipv6Ranges.push_back(value); return *this; } /** *The IPv6 ranges.
*/ inline AwsEc2SecurityGroupIpPermission& AddIpv6Ranges(AwsEc2SecurityGroupIpv6Range&& value) { m_ipv6RangesHasBeenSet = true; m_ipv6Ranges.push_back(std::move(value)); return *this; } /** *[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline const Aws::Vector[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline bool PrefixListIdsHasBeenSet() const { return m_prefixListIdsHasBeenSet; } /** *[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline void SetPrefixListIds(const Aws::Vector[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline void SetPrefixListIds(Aws::Vector[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline AwsEc2SecurityGroupIpPermission& WithPrefixListIds(const Aws::Vector[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline AwsEc2SecurityGroupIpPermission& WithPrefixListIds(Aws::Vector[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline AwsEc2SecurityGroupIpPermission& AddPrefixListIds(const AwsEc2SecurityGroupPrefixListId& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds.push_back(value); return *this; } /** *[VPC only] The prefix list IDs for an Amazon Web Services service. With * outbound rules, this is the Amazon Web Services service to access through a VPC * endpoint from instances associated with the security group.
*/ inline AwsEc2SecurityGroupIpPermission& AddPrefixListIds(AwsEc2SecurityGroupPrefixListId&& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds.push_back(std::move(value)); return *this; } private: Aws::String m_ipProtocol; bool m_ipProtocolHasBeenSet = false; int m_fromPort; bool m_fromPortHasBeenSet = false; int m_toPort; bool m_toPortHasBeenSet = false; Aws::Vector