Skip to content

create_dns_view async

create_dns_view(
    global_resolver_id: ResourceId,
    name: ResourceName,
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    dnssec_validation: Optional[DnsSecValidationType] = None,
    edns_client_subnet: Optional[EdnsClientSubnetType] = None,
    firewall_rules_fail_open: Optional[FirewallRulesFailOpenType] = None,
    description: Optional[ResourceDescription] = None,
    tags: Optional[Tags] = None,
) -> CreateDNSViewOutput

Creates a DNS view within a Route 53 Global Resolver. A DNS view models end users, user groups, networks, and devices, and serves as a parent resource that holds configurations controlling access, authorization, DNS firewall rules, and forwarding rules.

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:

  • global_resolver_id (ResourceId) –

    The ID of the Route 53 Global Resolver to associate with this DNS view.

  • client_token (Optional[ClientToken], default: None ) –

    A unique string that identifies the request and ensures idempotency.

  • name (ResourceName) –

    A descriptive name for the DNS view.

  • dnssec_validation (Optional[DnsSecValidationType], default: None ) –

    Whether to enable DNSSEC validation for DNS queries in this DNS view. When enabled, the resolver verifies the authenticity and integrity of DNS responses from public name servers for DNSSEC-signed domains.

  • edns_client_subnet (Optional[EdnsClientSubnetType], default: None ) –

    Whether to enable EDNS Client Subnet injection for DNS queries in this DNS view. When enabled, client subnet information is forwarded to provide more accurate geographic-based DNS responses.

  • firewall_rules_fail_open (Optional[FirewallRulesFailOpenType], default: None ) –

    Determines the behavior when Route 53 Global Resolver cannot apply DNS firewall rules due to service impairment. When enabled, DNS queries are allowed through; when disabled, queries are blocked.

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

    An optional description for the DNS view.

  • tags (Optional[Tags], default: None ) –

    Tags to associate with the DNS view.

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 create_dns_view(
    self,
    global_resolver_id: "capo_route53globalresolver.types.resource_id.ResourceId",
    name: "capo_route53globalresolver.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
    client_token: Optional[
        "capo_route53globalresolver.types.client_token.ClientToken"
    ] = None,
    dnssec_validation: Optional[
        "capo_route53globalresolver.types.dns_sec_validation_type.DnsSecValidationType"
    ] = None,
    edns_client_subnet: Optional[
        "capo_route53globalresolver.types.edns_client_subnet_type.EdnsClientSubnetType"
    ] = None,
    firewall_rules_fail_open: Optional[
        "capo_route53globalresolver.types.firewall_rules_fail_open_type.FirewallRulesFailOpenType"
    ] = None,
    description: Optional[
        "capo_route53globalresolver.types.resource_description.ResourceDescription"
    ] = None,
    tags: Optional["capo_route53globalresolver.types.tags.Tags"] = None,
) -> "capo_route53globalresolver.types.create_dns_view_output.CreateDNSViewOutput":
    """<p>Creates a DNS view within a Route 53 Global Resolver. A DNS view models end users, user groups, networks, and devices, and serves as a parent resource that holds configurations controlling access, authorization, DNS firewall rules, and forwarding rules.</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:
        global_resolver_id: <p>The ID of the Route 53 Global Resolver to associate with this DNS view.</p>
        client_token: <p>A unique string that identifies the request and ensures idempotency.</p>
        name: <p>A descriptive name for the DNS view.</p>
        dnssec_validation: <p>Whether to enable DNSSEC validation for DNS queries in this DNS view. When enabled, the resolver verifies the authenticity and integrity of DNS responses from public name servers for DNSSEC-signed domains.</p>
        edns_client_subnet: <p>Whether to enable EDNS Client Subnet injection for DNS queries in this DNS view. When enabled, client subnet information is forwarded to provide more accurate geographic-based DNS responses.</p>
        firewall_rules_fail_open: <p>Determines the behavior when Route 53 Global Resolver cannot apply DNS firewall rules due to service impairment. When enabled, DNS queries are allowed through; when disabled, queries are blocked.</p>
        description: <p>An optional description for the DNS view.</p>
        tags: <p>Tags to associate with the DNS view.</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.create_dns_view_input.CreateDNSViewInput]",
    ) -> AsyncOperationResponse[
        "capo_route53globalresolver.types.create_dns_view_output.CreateDNSViewOutput"
    ]:
        import capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.create_dns_view

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDNSView")
    )
    input_: capo_route53globalresolver.types.create_dns_view_input.CreateDNSViewInput = {
        "global_resolver_id": global_resolver_id,
        "name": name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if dnssec_validation is not None:
        input_["dnssec_validation"] = dnssec_validation
    if edns_client_subnet is not None:
        input_["edns_client_subnet"] = edns_client_subnet
    if firewall_rules_fail_open is not None:
        input_["firewall_rules_fail_open"] = firewall_rules_fail_open
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

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