Skip to content

delete_network_acl_entry

delete_network_acl_entry(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    network_acl_id: Optional[NetworkAclId] = None,
    rule_number: Optional[Integer] = None,
    egress: Optional[Boolean] = None,
) -> None

Deletes the specified ingress or egress entry (rule) from the specified network ACL.

Parameters:

  • 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 is UnauthorizedOperation.

  • network_acl_id (Optional[NetworkAclId], default: None ) –

    The ID of the network ACL.

  • rule_number (Optional[Integer], default: None ) –

    The rule number of the entry to delete.

  • egress (Optional[Boolean], default: None ) –

    Indicates whether the rule is an egress rule.

Raises:

Examples:

To delete a network ACL entry This example deletes ingress rule number 100 from the specified network ACL.

>>> client.delete_network_acl_entry(network_acl_id='acl-5fb85d36', rule_number=100, egress=True)
Source code in docs_src/capo_ec2/_services/ec2.py
def delete_network_acl_entry(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    network_acl_id: Optional["capo_ec2.types.network_acl_id.NetworkAclId"] = None,
    rule_number: Optional["capo_ec2.types.integer.Integer"] = None,
    egress: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> None:
    """<p>Deletes the specified ingress or egress entry (rule) from the specified network ACL.</p>

    Args:
        dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        network_acl_id: <p>The ID of the network ACL.</p>
        rule_number: <p>The rule number of the entry to delete.</p>
        egress: <p>Indicates whether the rule is an egress rule.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete a network ACL entry
        This example deletes ingress rule number 100 from the specified network ACL.

        >>> client.delete_network_acl_entry(network_acl_id='acl-5fb85d36', rule_number=100, egress=True)
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.delete_network_acl_entry_request.DeleteNetworkAclEntryRequest]",
    ) -> OperationResponse[None]:
        import capo_ec2._operations.amazon_ec2.delete_network_acl_entry

        output, http_response = (
            capo_ec2._operations.amazon_ec2.delete_network_acl_entry.delete_network_acl_entry(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteNetworkAclEntry")
    )
    input_: capo_ec2.types.delete_network_acl_entry_request.DeleteNetworkAclEntryRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if network_acl_id is not None:
        input_["network_acl_id"] = network_acl_id
    if rule_number is not None:
        input_["rule_number"] = rule_number
    if egress is not None:
        input_["egress"] = egress

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output