createFirewallDomainList method

Future<CreateFirewallDomainListOutput> createFirewallDomainList({
  1. required String globalResolverId,
  2. required String name,
  3. String? clientToken,
  4. String? description,
  5. Map<String, String>? tags,
})

Creates a firewall domain list. Domain lists are reusable sets of domain specifications that you use in DNS firewall rules to allow, block, or alert on DNS queries to specific domains.

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 that the domain list will be associated with.

Parameter name : A descriptive name for the firewall domain list.

Parameter clientToken : A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same clientToken has the same result every time.

Parameter description : An optional description for the firewall domain list.

Parameter tags : An array of user-defined keys and optional values. These tags can be used for categorization and organization.

Implementation

Future<CreateFirewallDomainListOutput> createFirewallDomainList({
  required String globalResolverId,
  required String name,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/firewall-domain-lists/${Uri.encodeComponent(globalResolverId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateFirewallDomainListOutput.fromJson(response);
}