createGlobalResolver method

Future<CreateGlobalResolverOutput> createGlobalResolver({
  1. required String name,
  2. required List<String> regions,
  3. String? clientToken,
  4. String? description,
  5. GlobalResolverIpAddressType? ipAddressType,
  6. String? observabilityRegion,
  7. Map<String, String>? tags,
})

Creates a new Route 53 Global Resolver instance. A Route 53 Global Resolver is a global, internet-accessible DNS resolver that provides secure DNS resolution for both public and private domains through global anycast IP addresses.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter name : A descriptive name for the Route 53 Global Resolver instance. Maximum length of 64 characters.

Parameter regions : List of Amazon Web Services Regions where the Route 53 Global Resolver will operate. The resolver will be distributed across these Regions to provide global availability and low-latency DNS resolution.

Parameter clientToken : A unique string that identifies the request and ensures idempotency. If you make multiple requests with the same client token, only one Route 53 Global Resolver is created.

Parameter description : An optional description for the Route 53 Global Resolver instance. Maximum length of 1024 characters.

Parameter ipAddressType : The IP address type for the Route 53 Global Resolver. Valid values are IPV4 (default) or DUAL_STACK for both IPv4 and IPv6 support.

Parameter observabilityRegion : The Amazon Web Services Region where query resolution logs and metrics will be aggregated and delivered. If not specified, logging is not enabled.

Parameter tags : Tags to associate with the Route 53 Global Resolver. Tags are key-value pairs that help you organize and identify your resources.

Implementation

Future<CreateGlobalResolverOutput> createGlobalResolver({
  required String name,
  required List<String> regions,
  String? clientToken,
  String? description,
  GlobalResolverIpAddressType? ipAddressType,
  String? observabilityRegion,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'regions': regions,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (ipAddressType != null) 'ipAddressType': ipAddressType.value,
    if (observabilityRegion != null)
      'observabilityRegion': observabilityRegion,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/global-resolver',
    exceptionFnMap: _exceptionFns,
  );
  return CreateGlobalResolverOutput.fromJson(response);
}