Skip to content

list_firewall_rule_domains async

list_firewall_rule_domains(
    firewall_rule_group_id: ResourceId,
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
    firewall_threat_protection_id: Optional[ResourceId] = None,
    firewall_domain_list_id: Optional[ResourceId] = None,
    query_options: Optional[ListFirewallRuleDomainsQueryOptions] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListFirewallRuleDomainsResponse

Retrieves the domains of an AutoAllowlist firewall rule. Only the owner of the rule group can call this operation. Results are paginated. Use MaxResults and NextToken to retrieve additional domains.

Identify the rule by FirewallThreatProtectionId to get the domains that DNS Firewall observed in the VPCs that use the rule group, through a rule group association or through a Route 53 Profile that includes the rule group, including VPCs in other accounts. Each domain is returned with its DomainStatus and request counts. Use QueryOptions to filter and sort the results.

Identify the rule's managed domain list by FirewallDomainListId to get the domains that the rule currently allows. For any other domain list, use ListFirewallDomains.

Parameters:

  • firewall_rule_group_id (ResourceId) –

    The unique identifier of the firewall rule group that contains the rule.

  • firewall_threat_protection_id (Optional[ResourceId], default: None ) –

    The threat protection ID that identifies an AutoAllowlist rule. Provide this to list an AutoAllowlist rule's domains.

  • firewall_domain_list_id (Optional[ResourceId], default: None ) –

    The ID of the AutoAllowlist rule's managed domain list. Provide this to list the domains that the rule currently allows.

  • query_options (Optional[ListFirewallRuleDomainsQueryOptions], default: None ) –

    Optional filters and sort order for the returned domains. If you don't specify this, the operation returns the OBSERVED domains sorted by TIME_ADDED in descending order. See ListFirewallRuleDomainsQueryOptions.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of domains that you want to return in a single call. If more domains remain than can be returned, the response includes a NextToken value that you can use in a subsequent call to get the next batch. The default is 100.

  • next_token (Optional[NextToken], default: None ) –

    For the first call to this operation, omit this value. If more domains remain than can be returned in a single call, the response includes a NextToken value. In your next call, specify that value to get the next batch of domains.

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.

  • InternalServiceErrorException –

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

  • 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 list_firewall_rule_domains(
    self,
    firewall_rule_group_id: "capo_route53resolver.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[AsyncRoute53ResolverClientConfig] = None,
    firewall_threat_protection_id: Optional[
        "capo_route53resolver.types.resource_id.ResourceId"
    ] = None,
    firewall_domain_list_id: Optional[
        "capo_route53resolver.types.resource_id.ResourceId"
    ] = None,
    query_options: Optional[
        "capo_route53resolver.types.list_firewall_rule_domains_query_options.ListFirewallRuleDomainsQueryOptions"
    ] = None,
    max_results: Optional[
        "capo_route53resolver.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_route53resolver.types.next_token.NextToken"] = None,
) -> "capo_route53resolver.types.list_firewall_rule_domains_response.ListFirewallRuleDomainsResponse":
    """<p>Retrieves the domains of an AutoAllowlist firewall rule. Only the owner of the rule group can call this operation. Results are paginated. Use <code>MaxResults</code> and <code>NextToken</code> to retrieve additional domains.</p> <p>Identify the rule by <code>FirewallThreatProtectionId</code> to get the domains that DNS Firewall observed in the VPCs that use the rule group, through a rule group association or through a Route 53 Profile that includes the rule group, including VPCs in other accounts. Each domain is returned with its <code>DomainStatus</code> and request counts. Use <code>QueryOptions</code> to filter and sort the results.</p> <p>Identify the rule's managed domain list by <code>FirewallDomainListId</code> to get the domains that the rule currently allows. For any other domain list, use <a>ListFirewallDomains</a>.</p>

    Args:
        firewall_rule_group_id: <p>The unique identifier of the firewall rule group that contains the rule.</p>
        firewall_threat_protection_id: <p>The threat protection ID that identifies an AutoAllowlist rule. Provide this to list an AutoAllowlist rule's domains.</p>
        firewall_domain_list_id: <p>The ID of the AutoAllowlist rule's managed domain list. Provide this to list the domains that the rule currently allows.</p>
        query_options: <p>Optional filters and sort order for the returned domains. If you don't specify this, the operation returns the <code>OBSERVED</code> domains sorted by <code>TIME_ADDED</code> in descending order. See <a>ListFirewallRuleDomainsQueryOptions</a>.</p>
        max_results: <p>The maximum number of domains that you want to return in a single call. If more domains remain than can be returned, the response includes a <code>NextToken</code> value that you can use in a subsequent call to get the next batch. The default is 100.</p>
        next_token: <p>For the first call to this operation, omit this value. If more domains remain than can be returned in a single call, the response includes a <code>NextToken</code> value. In your next call, specify that value to get the next batch of domains.</p>

    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.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</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.list_firewall_rule_domains_request.ListFirewallRuleDomainsRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53resolver.types.list_firewall_rule_domains_response.ListFirewallRuleDomainsResponse"
    ]:
        import capo_route53resolver._operations.route53_resolver.list_firewall_rule_domains

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFirewallRuleDomains")
    )
    input_: capo_route53resolver.types.list_firewall_rule_domains_request.ListFirewallRuleDomainsRequest = {
        "firewall_rule_group_id": firewall_rule_group_id
    }
    if firewall_threat_protection_id is not None:
        input_["firewall_threat_protection_id"] = firewall_threat_protection_id
    if firewall_domain_list_id is not None:
        input_["firewall_domain_list_id"] = firewall_domain_list_id
    if query_options is not None:
        input_["query_options"] = query_options
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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