createDomain method
Creates a domain resource for the specified domain (example.com).
The create domain operation supports tag-based access control
via request tags. For more information, see the Amazon
Lightsail Developer Guide.
May throw AccessDeniedException.
May throw AccountSetupInProgressException.
May throw InvalidInputException.
May throw NotFoundException.
May throw OperationFailureException.
May throw RegionSetupInProgressException.
May throw ServiceException.
May throw UnauthenticatedException.
Parameter domainName :
The domain name to manage (example.com).
Parameter tags :
The tag keys and optional values to add to the resource during create.
Use the TagResource action to tag a resource after it's
created.
Implementation
Future<CreateDomainResult> createDomain({
required String domainName,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.CreateDomain'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'domainName': domainName,
if (tags != null) 'tags': tags,
},
);
return CreateDomainResult.fromJson(jsonResponse.body);
}