Skip to content

import_firewall_domains

import_firewall_domains(
    domain_file_url: str,
    firewall_domain_list_id: ResourceId,
    operation: str,
    *,
    config_overrides: Optional[Route53GlobalResolverClientConfig] = None,
) -> ImportFirewallDomainsOutput

Imports a list of domains from an Amazon S3 file into a firewall domain list. The file should contain one domain per line.

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:

  • domain_file_url (str) –

    The fully qualified URL of the file in Amazon S3 that contains the list of domains to import. The file should contain one domain per line.

  • firewall_domain_list_id (ResourceId) –

    ID of the DNS Firewall domain list that you want to import the domain list to.

  • operation (str) –

    This value is REPLACE, and it updates the domain list to match the list of domains in the imported file.

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/route53_global_resolver.py
def import_firewall_domains(
    self,
    domain_file_url: str,
    firewall_domain_list_id: "capo_route53globalresolver.types.resource_id.ResourceId",
    operation: str,
    *,
    config_overrides: Optional[Route53GlobalResolverClientConfig] = None,
) -> "capo_route53globalresolver.types.import_firewall_domains_output.ImportFirewallDomainsOutput":
    """<p>Imports a list of domains from an Amazon S3 file into a firewall domain list. The file should contain one domain per line.</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:
        domain_file_url: <p>The fully qualified URL of the file in Amazon S3 that contains the list of domains to import. The file should contain one domain per line.</p>
        firewall_domain_list_id: <p>ID of the DNS Firewall domain list that you want to import the domain list to.</p>
        operation: <p>This value is <code>REPLACE</code>, and it updates the domain list to match the list of domains in the imported file.</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.
    """

    def _handler(
        req: "OperationRequest[capo_route53globalresolver.types.import_firewall_domains_input.ImportFirewallDomainsInput]",
    ) -> OperationResponse[
        "capo_route53globalresolver.types.import_firewall_domains_output.ImportFirewallDomainsOutput"
    ]:
        import capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.import_firewall_domains

        output, http_response = (
            capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.import_firewall_domains.import_firewall_domains(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportFirewallDomains")
    )
    input_: capo_route53globalresolver.types.import_firewall_domains_input.ImportFirewallDomainsInput = {
        "domain_file_url": domain_file_url,
        "firewall_domain_list_id": firewall_domain_list_id,
        "operation": operation,
    }

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