revoke_security_group_ingress
¶
revoke_security_group_ingress(
*,
config_overrides: Optional[EC2ClientConfig] = None,
cidr_ip: Optional[String] = None,
from_port: Optional[Integer] = None,
group_id: Optional[SecurityGroupId] = None,
group_name: Optional[SecurityGroupName] = None,
ip_permissions: Optional[IpPermissionList] = None,
ip_protocol: Optional[String] = None,
source_security_group_name: Optional[String] = None,
source_security_group_owner_id: Optional[String] = None,
to_port: Optional[Integer] = None,
security_group_rule_ids: Optional[SecurityGroupRuleIdList] = None,
dry_run: Optional[Boolean] = None,
) -> RevokeSecurityGroupIngressResult
Removes the specified inbound (ingress) rules from a security group.
You can specify rules using either rule IDs or security group rule properties. If you use rule properties, the values that you specify (for example, ports) must match the existing rule's values exactly. Each rule has a protocol, from and to ports, and source (CIDR range, security group, or prefix list). For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not need to specify the description to revoke the rule.
For a default VPC, if the values you specify do not match the existing rule's values, no error is returned, and the output describes the security group rules that were not revoked.
For a non-default VPC, if the values you specify do not match the existing rule's values, an InvalidPermission.NotFound client error is returned, and no rules are revoked.
Amazon Web Services recommends that you describe the security group to verify that the rules were removed.
Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
Parameters:
-
cidr_ip(Optional[String], default:None) –The CIDR IP address range. You can't specify this parameter when specifying a source security group.
-
from_port(Optional[Integer], default:None) –If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the ICMP type or -1 (all ICMP types).
-
group_id(Optional[SecurityGroupId], default:None) –The ID of the security group.
-
group_name(Optional[SecurityGroupName], default:None) –[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.
-
ip_permissions(Optional[IpPermissionList], default:None) –The sets of IP permissions. You can't specify a source security group and a CIDR IP address range in the same set of permissions.
-
ip_protocol(Optional[String], default:None) –The IP protocol name (
tcp,udp,icmp) or number (see Protocol Numbers). Use-1to specify all. -
source_security_group_name(Optional[String], default:None) –[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. The source security group must be in the same VPC. To revoke a specific rule for an IP protocol and port range, use a set of IP permissions instead.
-
source_security_group_owner_id(Optional[String], default:None) –Not supported.
-
to_port(Optional[Integer], default:None) –If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the ICMP code or -1 (all ICMP codes).
-
security_group_rule_ids(Optional[SecurityGroupRuleIdList], default:None) –The IDs of the security group rules.
-
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
58573 58574 58575 58576 58577 58578 58579 58580 58581 58582 58583 58584 58585 58586 58587 58588 58589 58590 58591 58592 58593 58594 58595 58596 58597 58598 58599 58600 58601 58602 58603 58604 58605 58606 58607 58608 58609 58610 58611 58612 58613 58614 58615 58616 58617 58618 58619 58620 58621 58622 58623 58624 58625 58626 58627 58628 58629 58630 58631 58632 58633 58634 58635 58636 58637 58638 58639 58640 58641 58642 58643 58644 58645 58646 58647 58648 58649 58650 58651 58652 58653 58654 58655 58656 58657 58658 58659 58660 58661 | |