Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Adds the specified inbound (ingress) rules to a security group.
An inbound rule permits instances to receive traffic from the specified
IPv4 or IPv6 CIDR address range, or from the instances that are
associated with the specified destination security groups. When
specifying an inbound rule for your security group in a VPC, the
IpPermissions
must include a source for the traffic.
You specify a protocol for each rule (for example, TCP). For TCP and UDP, you must also specify the destination port or port range. For ICMP/ICMPv6, you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean all types or all codes.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
For more information about VPC security group quotas, see Amazon VPC quotas.
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.
Synopsis
- data AuthorizeSecurityGroupIngress = AuthorizeSecurityGroupIngress' {
- cidrIp :: Maybe Text
- dryRun :: Maybe Bool
- fromPort :: Maybe Int
- groupId :: Maybe Text
- groupName :: Maybe Text
- ipPermissions :: Maybe [IpPermission]
- ipProtocol :: Maybe Text
- sourceSecurityGroupName :: Maybe Text
- sourceSecurityGroupOwnerId :: Maybe Text
- tagSpecifications :: Maybe [TagSpecification]
- toPort :: Maybe Int
- newAuthorizeSecurityGroupIngress :: AuthorizeSecurityGroupIngress
- authorizeSecurityGroupIngress_cidrIp :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_dryRun :: Lens' AuthorizeSecurityGroupIngress (Maybe Bool)
- authorizeSecurityGroupIngress_fromPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int)
- authorizeSecurityGroupIngress_groupId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_groupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_ipPermissions :: Lens' AuthorizeSecurityGroupIngress (Maybe [IpPermission])
- authorizeSecurityGroupIngress_ipProtocol :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_sourceSecurityGroupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_sourceSecurityGroupOwnerId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text)
- authorizeSecurityGroupIngress_tagSpecifications :: Lens' AuthorizeSecurityGroupIngress (Maybe [TagSpecification])
- authorizeSecurityGroupIngress_toPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int)
- data AuthorizeSecurityGroupIngressResponse = AuthorizeSecurityGroupIngressResponse' {}
- newAuthorizeSecurityGroupIngressResponse :: Int -> AuthorizeSecurityGroupIngressResponse
- authorizeSecurityGroupIngressResponse_return :: Lens' AuthorizeSecurityGroupIngressResponse (Maybe Bool)
- authorizeSecurityGroupIngressResponse_securityGroupRules :: Lens' AuthorizeSecurityGroupIngressResponse (Maybe [SecurityGroupRule])
- authorizeSecurityGroupIngressResponse_httpStatus :: Lens' AuthorizeSecurityGroupIngressResponse Int
Creating a Request
data AuthorizeSecurityGroupIngress Source #
See: newAuthorizeSecurityGroupIngress
smart constructor.
AuthorizeSecurityGroupIngress' | |
|
Instances
newAuthorizeSecurityGroupIngress :: AuthorizeSecurityGroupIngress Source #
Create a value of AuthorizeSecurityGroupIngress
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_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.
$sel:dryRun:AuthorizeSecurityGroupIngress'
, authorizeSecurityGroupIngress_dryRun
- Checks whether you have the required permissions for the action, without
actually making the request, and provides an error response. If you have
the required permissions, the error response is DryRunOperation
.
Otherwise, it is UnauthorizedOperation
.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_fromPort
- The start of port range for the TCP and UDP protocols, or an ICMP type
number. For the ICMP type number, use -1
to specify all types. If you
specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_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.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_groupName
- [EC2-Classic, 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.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_ipPermissions
- The sets of IP permissions.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_ipProtocol
- The IP protocol name (tcp
, udp
, icmp
) or number (see
Protocol Numbers).
To specify icmpv6
, use a set of IP permissions.
- VPC only
- Use
-1
to specify all protocols. If you specify-1
or a protocol other thantcp
,udp
, oricmp
, 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.
$sel:sourceSecurityGroupName:AuthorizeSecurityGroupIngress'
, authorizeSecurityGroupIngress_sourceSecurityGroupName
- [EC2-Classic, 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. For
EC2-VPC, the source security group must be in the same VPC.
$sel:sourceSecurityGroupOwnerId:AuthorizeSecurityGroupIngress'
, authorizeSecurityGroupIngress_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.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_tagSpecifications
- [VPC Only] The tags applied to the security group rule.
AuthorizeSecurityGroupIngress
, authorizeSecurityGroupIngress_toPort
- The end of port range for the TCP and UDP protocols, or an ICMP code
number. For the ICMP code number, use -1
to specify all codes. If you
specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
Request Lenses
authorizeSecurityGroupIngress_cidrIp :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
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.
authorizeSecurityGroupIngress_dryRun :: Lens' AuthorizeSecurityGroupIngress (Maybe Bool) Source #
Checks whether you have the required permissions for the action, without
actually making the request, and provides an error response. If you have
the required permissions, the error response is DryRunOperation
.
Otherwise, it is UnauthorizedOperation
.
authorizeSecurityGroupIngress_fromPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int) Source #
The start of port range for the TCP and UDP protocols, or an ICMP type
number. For the ICMP type number, use -1
to specify all types. If you
specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
authorizeSecurityGroupIngress_groupId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
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.
authorizeSecurityGroupIngress_groupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
- EC2-Classic, 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.
authorizeSecurityGroupIngress_ipPermissions :: Lens' AuthorizeSecurityGroupIngress (Maybe [IpPermission]) Source #
The sets of IP permissions.
authorizeSecurityGroupIngress_ipProtocol :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
The IP protocol name (tcp
, udp
, icmp
) or number (see
Protocol Numbers).
To specify icmpv6
, use a set of IP permissions.
- VPC only
- Use
-1
to specify all protocols. If you specify-1
or a protocol other thantcp
,udp
, oricmp
, 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.
authorizeSecurityGroupIngress_sourceSecurityGroupName :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
- EC2-Classic, 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. For EC2-VPC, the source security group must be in the same VPC.
authorizeSecurityGroupIngress_sourceSecurityGroupOwnerId :: Lens' AuthorizeSecurityGroupIngress (Maybe Text) Source #
- 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.
authorizeSecurityGroupIngress_tagSpecifications :: Lens' AuthorizeSecurityGroupIngress (Maybe [TagSpecification]) Source #
- VPC Only
- The tags applied to the security group rule.
authorizeSecurityGroupIngress_toPort :: Lens' AuthorizeSecurityGroupIngress (Maybe Int) Source #
The end of port range for the TCP and UDP protocols, or an ICMP code
number. For the ICMP code number, use -1
to specify all codes. If you
specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules and a description for the rule.
Destructuring the Response
data AuthorizeSecurityGroupIngressResponse Source #
See: newAuthorizeSecurityGroupIngressResponse
smart constructor.
AuthorizeSecurityGroupIngressResponse' | |
|
Instances
newAuthorizeSecurityGroupIngressResponse Source #
Create a value of AuthorizeSecurityGroupIngressResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:return':AuthorizeSecurityGroupIngressResponse'
, authorizeSecurityGroupIngressResponse_return
- Returns true
if the request succeeds; otherwise, returns an error.
$sel:securityGroupRules:AuthorizeSecurityGroupIngressResponse'
, authorizeSecurityGroupIngressResponse_securityGroupRules
- Information about the inbound (ingress) security group rules that were
added.
$sel:httpStatus:AuthorizeSecurityGroupIngressResponse'
, authorizeSecurityGroupIngressResponse_httpStatus
- The response's http status code.
Response Lenses
authorizeSecurityGroupIngressResponse_return :: Lens' AuthorizeSecurityGroupIngressResponse (Maybe Bool) Source #
Returns true
if the request succeeds; otherwise, returns an error.
authorizeSecurityGroupIngressResponse_securityGroupRules :: Lens' AuthorizeSecurityGroupIngressResponse (Maybe [SecurityGroupRule]) Source #
Information about the inbound (ingress) security group rules that were added.
authorizeSecurityGroupIngressResponse_httpStatus :: Lens' AuthorizeSecurityGroupIngressResponse Int Source #
The response's http status code.