createDNSView method
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.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter globalResolverId :
The ID of the Route 53 Global Resolver to associate with this DNS view.
Parameter name :
A descriptive name for the DNS view.
Parameter clientToken :
A unique string that identifies the request and ensures idempotency.
Parameter description :
An optional description for the DNS view.
Parameter dnssecValidation :
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.
Parameter ednsClientSubnet :
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.
Parameter firewallRulesFailOpen :
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.
Parameter tags :
Tags to associate with the DNS view.
Implementation
Future<CreateDNSViewOutput> createDNSView({
required String globalResolverId,
required String name,
String? clientToken,
String? description,
DnsSecValidationType? dnssecValidation,
EdnsClientSubnetType? ednsClientSubnet,
FirewallRulesFailOpenType? firewallRulesFailOpen,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (dnssecValidation != null) 'dnssecValidation': dnssecValidation.value,
if (ednsClientSubnet != null) 'ednsClientSubnet': ednsClientSubnet.value,
if (firewallRulesFailOpen != null)
'firewallRulesFailOpen': firewallRulesFailOpen.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/dns-views/${Uri.encodeComponent(globalResolverId)}',
exceptionFnMap: _exceptionFns,
);
return CreateDNSViewOutput.fromJson(response);
}