associateIdentityProviderConfig method

Future<AssociateIdentityProviderConfigResponse> associateIdentityProviderConfig({
  1. required String clusterName,
  2. required OidcIdentityProviderConfigRequest oidc,
  3. String? clientRequestToken,
  4. Map<String, String>? tags,
})

Associates an identity provider configuration to a cluster.

If you want to authenticate identities using an identity provider, you can create an identity provider configuration and associate it to your cluster. After configuring authentication to your cluster you can create Kubernetes Role and ClusterRole objects, assign permissions to them, and then bind them to the identities using Kubernetes RoleBinding and ClusterRoleBinding objects. For more information see Using RBAC Authorization in the Kubernetes documentation.

May throw ClientException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ServerException. May throw ThrottlingException.

Parameter clusterName : The name of your cluster.

Parameter oidc : An object representing an OpenID Connect (OIDC) identity provider configuration.

Parameter clientRequestToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter tags : Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

Implementation

Future<AssociateIdentityProviderConfigResponse>
    associateIdentityProviderConfig({
  required String clusterName,
  required OidcIdentityProviderConfigRequest oidc,
  String? clientRequestToken,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'oidc': oidc,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/clusters/${Uri.encodeComponent(clusterName)}/identity-provider-configs/associate',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateIdentityProviderConfigResponse.fromJson(response);
}