createAcmeExternalAccountBinding method
Creates an external account binding (EAB) for an ACME endpoint. An EAB provides credentials that authorize an ACME client to register an account with the endpoint. Each EAB is associated with an IAM role that controls what certificate operations the ACME client can perform.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter acmeEndpointArn :
The Amazon Resource Name (ARN) of the ACME endpoint.
Parameter roleArn :
The Amazon Resource Name (ARN) of the IAM role to associate with the
external account binding.
Parameter expiration :
The expiration configuration for the external account binding.
Parameter idempotencyToken :
A unique, case-sensitive identifier to ensure idempotency of the request.
Parameter tags :
One or more tags to associate with the external account binding.
Implementation
Future<CreateAcmeExternalAccountBindingResponse>
createAcmeExternalAccountBinding({
required String acmeEndpointArn,
required String roleArn,
Expiration? expiration,
String? idempotencyToken,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CertificateManager.CreateAcmeExternalAccountBinding'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AcmeEndpointArn': acmeEndpointArn,
'RoleArn': roleArn,
if (expiration != null) 'Expiration': expiration,
'IdempotencyToken': idempotencyToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'Tags': tags,
},
endpoint: _resolveEndpoint(
serviceType: 'ACM-ACME',
),
);
return CreateAcmeExternalAccountBindingResponse.fromJson(jsonResponse.body);
}