createTrustAnchor method

Future<TrustAnchorDetailResponse> createTrustAnchor({
  1. required String name,
  2. required Source source,
  3. bool? enabled,
  4. List<NotificationSetting>? notificationSettings,
  5. List<Tag>? tags,
})

Creates a trust anchor to establish trust between IAM Roles Anywhere and your certificate authority (CA). You can define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.

Required permissions: rolesanywhere:CreateTrustAnchor.

May throw AccessDeniedException. May throw ValidationException.

Parameter name : The name of the trust anchor.

Parameter source : The trust anchor type and its related certificate data.

Parameter enabled : Specifies whether the trust anchor is enabled.

Parameter notificationSettings : A list of notification settings to be associated to the trust anchor.

Parameter tags : The tags to attach to the trust anchor.

Implementation

Future<TrustAnchorDetailResponse> createTrustAnchor({
  required String name,
  required Source source,
  bool? enabled,
  List<NotificationSetting>? notificationSettings,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'source': source,
    if (enabled != null) 'enabled': enabled,
    if (notificationSettings != null)
      'notificationSettings': notificationSettings,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/trustanchors',
    exceptionFnMap: _exceptionFns,
  );
  return TrustAnchorDetailResponse.fromJson(response);
}