Skip to content

update_firewall_rule async

update_firewall_rule(
    client_token: ClientToken,
    firewall_rule_id: ResourceId,
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
    action: Optional[FirewallRuleAction] = None,
    block_override_dns_type: Optional[BlockOverrideDnsQueryType] = None,
    block_override_domain: Optional[Domain] = None,
    block_override_ttl: Optional[BlockOverrideTtl] = None,
    block_response: Optional[FirewallBlockResponse] = None,
    confidence_threshold: Optional[ConfidenceThreshold] = None,
    description: Optional[ResourceDescription] = None,
    dns_advanced_protection: Optional[DnsAdvancedProtection] = None,
    name: Optional[ResourceName] = None,
    priority: Optional[FirewallRulePriority] = None,
) -> UpdateFirewallRuleOutput

Updates the configuration of a DNS firewall rule.

Route 53 Global Resolver is a global service that supports resolvers in multiple Amazon Web Services Regions but you must specify the US East (Ohio) Region to create, update, or otherwise work with Route 53 Global Resolver resources. That is, for example, specify --region us-east-2 on Amazon Web Services CLI commands.

Parameters:

  • action (Optional[FirewallRuleAction], default: None ) –

    The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list, or a threat in a DNS Firewall Advanced rule.

  • block_override_dns_type (Optional[BlockOverrideDnsQueryType], default: None ) –

    The DNS record's type. This determines the format of the record value that you provided in BlockOverrideDomain. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

  • block_override_domain (Optional[Domain], default: None ) –

    The custom DNS record to send back in response to the query. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

  • block_override_ttl (Optional[BlockOverrideTtl], default: None ) –

    The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

  • block_response (Optional[FirewallBlockResponse], default: None ) –

    The way that you want DNS Firewall to block the request. Used for the rule action setting BLOCK.

  • client_token (ClientToken) –

    A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same clientToken has the same result every time.

  • confidence_threshold (Optional[ConfidenceThreshold], default: None ) –

    The confidence threshold for DNS Firewall Advanced. You must provide this value when you create a DNS Firewall Advanced rule.

  • description (Optional[ResourceDescription], default: None ) –

    The description for the Firewall rule.

  • dns_advanced_protection (Optional[DnsAdvancedProtection], default: None ) –

    The type of the DNS Firewall Advanced rule. Valid values are DGA, DNS_TUNNELING, and DICTIONARY_DGA.

  • firewall_rule_id (ResourceId) –

    The ID of the DNS Firewall rule.

  • name (Optional[ResourceName], default: None ) –

    The name of the DNS Firewall rule.

  • priority (Optional[FirewallRulePriority], default: None ) –

    The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.

Raises:

  • AccessDeniedException –

    You don't have permission to perform this operation. Check your IAM permissions and try again.

  • ConflictException –

    The request conflicts with the current state of the resource. This can occur when trying to modify a resource that is not in a valid state for the requested operation.

  • InternalServerException –

    An internal server error occurred. Try again later.

  • ResourceNotFoundException –

    The specified resource was not found. Verify the resource ID and try again.

  • ServiceQuotaExceededException –

    The request would exceed one or more service quotas. Check your current usage and quotas, then try again.

  • ThrottlingException –

    The request was throttled due to too many requests. Wait a moment and try again.

  • ValidationException –

    The input parameters are invalid. Check the parameter values and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route53globalresolver/_services/async_route53_global_resolver.py
async def update_firewall_rule(
    self,
    client_token: "capo_route53globalresolver.types.client_token.ClientToken",
    firewall_rule_id: "capo_route53globalresolver.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
    action: Optional[
        "capo_route53globalresolver.types.firewall_rule_action.FirewallRuleAction"
    ] = None,
    block_override_dns_type: Optional[
        "capo_route53globalresolver.types.block_override_dns_query_type.BlockOverrideDnsQueryType"
    ] = None,
    block_override_domain: Optional[
        "capo_route53globalresolver.types.domain.Domain"
    ] = None,
    block_override_ttl: Optional[
        "capo_route53globalresolver.types.block_override_ttl.BlockOverrideTtl"
    ] = None,
    block_response: Optional[
        "capo_route53globalresolver.types.firewall_block_response.FirewallBlockResponse"
    ] = None,
    confidence_threshold: Optional[
        "capo_route53globalresolver.types.confidence_threshold.ConfidenceThreshold"
    ] = None,
    description: Optional[
        "capo_route53globalresolver.types.resource_description.ResourceDescription"
    ] = None,
    dns_advanced_protection: Optional[
        "capo_route53globalresolver.types.dns_advanced_protection.DnsAdvancedProtection"
    ] = None,
    name: Optional[
        "capo_route53globalresolver.types.resource_name.ResourceName"
    ] = None,
    priority: Optional[
        "capo_route53globalresolver.types.firewall_rule_priority.FirewallRulePriority"
    ] = None,
) -> "capo_route53globalresolver.types.update_firewall_rule_output.UpdateFirewallRuleOutput":
    """<p>Updates the configuration of a DNS firewall rule.</p> <important> <p>Route 53 Global Resolver is a global service that supports resolvers in multiple Amazon Web Services Regions but you must specify the US East (Ohio) Region to create, update, or otherwise work with Route 53 Global Resolver resources. That is, for example, specify <code>--region us-east-2</code> on Amazon Web Services CLI commands.</p> </important>

    Args:
        action: <p>The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list, or a threat in a DNS Firewall Advanced rule.</p>
        block_override_dns_type: <p>The DNS record's type. This determines the format of the record value that you provided in <code>BlockOverrideDomain</code>. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
        block_override_domain: <p>The custom DNS record to send back in response to the query. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
        block_override_ttl: <p>The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
        block_response: <p>The way that you want DNS Firewall to block the request. Used for the rule action setting <code>BLOCK</code>.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same <code>clientToken</code> has the same result every time.</p>
        confidence_threshold: <p>The confidence threshold for DNS Firewall Advanced. You must provide this value when you create a DNS Firewall Advanced rule.</p>
        description: <p>The description for the Firewall rule.</p>
        dns_advanced_protection: <p>The type of the DNS Firewall Advanced rule. Valid values are DGA, DNS_TUNNELING, and DICTIONARY_DGA.</p>
        firewall_rule_id: <p>The ID of the DNS Firewall rule.</p>
        name: <p>The name of the DNS Firewall rule.</p>
        priority: <p>The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>

    Raises:
        capo_route53globalresolver.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform this operation. Check your IAM permissions and try again.</p>
        capo_route53globalresolver.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. This can occur when trying to modify a resource that is not in a valid state for the requested operation.</p>
        capo_route53globalresolver.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
        capo_route53globalresolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource ID and try again.</p>
        capo_route53globalresolver.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed one or more service quotas. Check your current usage and quotas, then try again.</p>
        capo_route53globalresolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Wait a moment and try again.</p>
        capo_route53globalresolver.errors.validation_exception.ValidationException: <p>The input parameters are invalid. Check the parameter values and try again.</p>
        capo_route53globalresolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53globalresolver.types.update_firewall_rule_input.UpdateFirewallRuleInput]",
    ) -> AsyncOperationResponse[
        "capo_route53globalresolver.types.update_firewall_rule_output.UpdateFirewallRuleOutput"
    ]:
        import capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.update_firewall_rule

        (
            output,
            http_response,
        ) = await capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.update_firewall_rule.async_update_firewall_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFirewallRule")
    )
    input_: capo_route53globalresolver.types.update_firewall_rule_input.UpdateFirewallRuleInput = {
        "client_token": client_token,
        "firewall_rule_id": firewall_rule_id,
    }
    if action is not None:
        input_["action"] = action
    if block_override_dns_type is not None:
        input_["block_override_dns_type"] = block_override_dns_type
    if block_override_domain is not None:
        input_["block_override_domain"] = block_override_domain
    if block_override_ttl is not None:
        input_["block_override_ttl"] = block_override_ttl
    if block_response is not None:
        input_["block_response"] = block_response
    if confidence_threshold is not None:
        input_["confidence_threshold"] = confidence_threshold
    if description is not None:
        input_["description"] = description
    if dns_advanced_protection is not None:
        input_["dns_advanced_protection"] = dns_advanced_protection
    if name is not None:
        input_["name"] = name
    if priority is not None:
        input_["priority"] = priority

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output