importFirewallDomains method
Imports domain names from a file into a domain list, for use in a DNS firewall rule group.
Each domain specification in your domain list must satisfy the following requirements:
-
It can optionally start with
*(asterisk). -
With the exception of the optional starting asterisk, it must only contain
the following characters:
A-Z,a-z,0-9,-(hyphen). - It must be from 1-255 characters in length.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServiceErrorException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainFileUrl :
The fully qualified URL or URI of the file stored in Amazon Simple Storage
Service (Amazon S3) that contains the list of domains to import.
The file must be in an S3 bucket that's in the same Region as your DNS Firewall. The file must be a text file and must contain a single domain per line.
Parameter firewallDomainListId :
The ID of the domain list that you want to modify with the import
operation.
Parameter operation :
What you want DNS Firewall to do with the domains that are listed in the
file. This must be set to REPLACE, which updates the domain
list to exactly match the list in the file.
Implementation
Future<ImportFirewallDomainsResponse> importFirewallDomains({
required String domainFileUrl,
required String firewallDomainListId,
required FirewallDomainImportOperation operation,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Route53Resolver.ImportFirewallDomains'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DomainFileUrl': domainFileUrl,
'FirewallDomainListId': firewallDomainListId,
'Operation': operation.value,
},
);
return ImportFirewallDomainsResponse.fromJson(jsonResponse.body);
}