Skip to content

update_firewall_domains async

update_firewall_domains(
    firewall_domain_list_id: ResourceId,
    operation: FirewallDomainUpdateOperation,
    domains: FirewallDomains,
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
) -> UpdateFirewallDomainsResponse

Updates the firewall domain list from an array of domain specifications.

For an AutoAllowlist rule's managed domain list, use ADD to approve observed domains, REMOVE to stop allowing domains, unless a wildcard entry that's still on the list matches them, and DENY to dismiss observed domains. REPLACE and ImportFirewallDomains aren't supported for these lists.

DNS Firewall throttles UpdateFirewallDomains requests based on both the request rate and the total number of domains across your requests.

Best Practice for Updating Domain Lists

If you only need to modify a subset of domains, use the ADD or REMOVE operations instead of REPLACE. With REPLACE, you send the complete list you want to end up with, and throttling counts every domain in that request, including domains that aren't changing, which can use up your available throttling capacity.

Parameters:

  • firewall_domain_list_id (ResourceId) –

    The ID of the domain list whose domains you want to update.

  • operation (FirewallDomainUpdateOperation) –

    What you want DNS Firewall to do with the domains that you are providing:

    • ADD - Add the domains to the ones that are already in the domain list. For an AutoAllowlist rule's managed domain list, this also marks the observed domains as allowed.

    • REMOVE - Search the domain list for the domains and remove them from the list. For an AutoAllowlist rule's managed domain list, the rule no longer allows the removed domains, unless a wildcard entry that's still on the list matches them.

    • REPLACE - Update the domain list to exactly match the list that you are providing. Not supported for an AutoAllowlist rule's managed domain list.

    • DENY - For an AutoAllowlist rule's managed domain list only, mark the specified observed domains as denied so that they're no longer listed for review. If a domain is on the managed domain list, DENY also removes it from the list. Specify fully qualified domain names. Wildcards aren't accepted.

  • domains (FirewallDomains) –

    A list of domains to use in the update operation.

    There is a limit of 1000 domains per request.

    Each domain specification in your domain list must satisfy the following requirements:

    • It can optionally start with * (asterisk).

    • With the exception of the optional starting asterisk, it must only contain the following characters: A-Z, a-z, 0-9, - (hyphen).

    • It must be from 1-255 characters in length.

Raises:

  • AccessDeniedException –

    The current account doesn't have the IAM permissions required to perform the specified Resolver operation.

    This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.

  • ConflictException –

    The requested state transition isn't valid. For example, you can't delete a firewall domain list if it is in the process of being deleted, or you can't import domains into a domain list that is in the process of being deleted.

  • InternalServiceErrorException –

    We encountered an unknown error. Try again in a few minutes.

  • LimitExceededException –

    The request caused one or more limits to be exceeded.

  • ResourceNotFoundException –

    The specified resource doesn't exist.

  • ThrottlingException –

    The request was throttled. Try again in a few minutes.

  • ValidationException –

    You have provided an invalid command. If you ran the UpdateFirewallDomains request. supported values are ADD, REMOVE, or REPLACE a domain.

  • UnknownServiceError –

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

Source code in docs_src/capo_route53resolver/_services/async_route53_resolver.py
async def update_firewall_domains(
    self,
    firewall_domain_list_id: "capo_route53resolver.types.resource_id.ResourceId",
    operation: "capo_route53resolver.types.firewall_domain_update_operation.FirewallDomainUpdateOperation",
    domains: "capo_route53resolver.types.firewall_domains.FirewallDomains",
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
) -> "capo_route53resolver.types.update_firewall_domains_response.UpdateFirewallDomainsResponse":
    """<p>Updates the firewall domain list from an array of domain specifications. </p> <p>For an AutoAllowlist rule's managed domain list, use <code>ADD</code> to approve observed domains, <code>REMOVE</code> to stop allowing domains, unless a wildcard entry that's still on the list matches them, and <code>DENY</code> to dismiss observed domains. <code>REPLACE</code> and <a>ImportFirewallDomains</a> aren't supported for these lists.</p> <p>DNS Firewall throttles <code>UpdateFirewallDomains</code> requests based on both the request rate and the total number of domains across your requests.</p> <p> <b>Best Practice for Updating Domain Lists</b> </p> <p>If you only need to modify a subset of domains, use the <code>ADD</code> or <code>REMOVE</code> operations instead of <code>REPLACE</code>. With <code>REPLACE</code>, you send the complete list you want to end up with, and throttling counts every domain in that request, including domains that aren't changing, which can use up your available throttling capacity.</p>

    Args:
        firewall_domain_list_id: <p>The ID of the domain list whose domains you want to update. </p>
        operation: <p>What you want DNS Firewall to do with the domains that you are providing: </p> <ul> <li> <p> <code>ADD</code> - Add the domains to the ones that are already in the domain list. For an AutoAllowlist rule's managed domain list, this also marks the observed domains as allowed.</p> </li> <li> <p> <code>REMOVE</code> - Search the domain list for the domains and remove them from the list. For an AutoAllowlist rule's managed domain list, the rule no longer allows the removed domains, unless a wildcard entry that's still on the list matches them.</p> </li> <li> <p> <code>REPLACE</code> - Update the domain list to exactly match the list that you are providing. Not supported for an AutoAllowlist rule's managed domain list.</p> </li> <li> <p> <code>DENY</code> - For an AutoAllowlist rule's managed domain list only, mark the specified observed domains as denied so that they're no longer listed for review. If a domain is on the managed domain list, <code>DENY</code> also removes it from the list. Specify fully qualified domain names. Wildcards aren't accepted.</p> </li> </ul>
        domains: <p>A list of domains to use in the update operation.</p> <important> <p>There is a limit of 1000 domains per request.</p> </important> <p>Each domain specification in your domain list must satisfy the following requirements: </p> <ul> <li> <p>It can optionally start with <code>*</code> (asterisk).</p> </li> <li> <p>With the exception of the optional starting asterisk, it must only contain the following characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>-</code> (hyphen).</p> </li> <li> <p>It must be from 1-255 characters in length. </p> </li> </ul>

    Raises:
        capo_route53resolver.errors.access_denied_exception.AccessDeniedException: <p>The current account doesn't have the IAM permissions required to perform the specified Resolver operation.</p> <p>This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.</p>
        capo_route53resolver.errors.conflict_exception.ConflictException: <p>The requested state transition isn't valid. For example, you can't delete a firewall domain list if it is in the process of being deleted, or you can't import domains into a domain list that is in the process of being deleted.</p>
        capo_route53resolver.errors.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</p>
        capo_route53resolver.errors.limit_exceeded_exception.LimitExceededException: <p>The request caused one or more limits to be exceeded.</p>
        capo_route53resolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_route53resolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Try again in a few minutes.</p>
        capo_route53resolver.errors.validation_exception.ValidationException: <p>You have provided an invalid command. If you ran the <code>UpdateFirewallDomains</code> request. supported values are <code>ADD</code>, <code>REMOVE</code>, or <code>REPLACE</code> a domain.</p>
        capo_route53resolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53resolver.types.update_firewall_domains_request.UpdateFirewallDomainsRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53resolver.types.update_firewall_domains_response.UpdateFirewallDomainsResponse"
    ]:
        import capo_route53resolver._operations.route53_resolver.update_firewall_domains

        (
            output,
            http_response,
        ) = await capo_route53resolver._operations.route53_resolver.update_firewall_domains.async_update_firewall_domains(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFirewallDomains")
    )
    input_: capo_route53resolver.types.update_firewall_domains_request.UpdateFirewallDomainsRequest = {
        "firewall_domain_list_id": firewall_domain_list_id,
        "operation": operation,
        "domains": domains,
    }

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