setupInstanceHttps method
Creates an SSL/TLS certificate that secures traffic for your website. After the certificate is created, it is installed on the specified Lightsail instance.
If you provide more than one domain name in the request, at least one name must be less than or equal to 63 characters in length.
May throw AccessDeniedException.
May throw InvalidInputException.
May throw NotFoundException.
May throw RegionSetupInProgressException.
May throw ServiceException.
May throw UnauthenticatedException.
Parameter certificateProvider :
The certificate authority that issues the SSL/TLS certificate.
Parameter domainNames :
The name of the domain and subdomains that were specified for the SSL/TLS
certificate.
Parameter emailAddress :
The contact method for SSL/TLS certificate renewal alerts. You can enter
one email address.
Parameter instanceName :
The name of the Lightsail instance.
Implementation
Future<SetupInstanceHttpsResult> setupInstanceHttps({
required CertificateProvider certificateProvider,
required List<String> domainNames,
required String emailAddress,
required String instanceName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.SetupInstanceHttps'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'certificateProvider': certificateProvider.value,
'domainNames': domainNames,
'emailAddress': emailAddress,
'instanceName': instanceName,
},
);
return SetupInstanceHttpsResult.fromJson(jsonResponse.body);
}