assumeRoleForPodIdentity method
The Amazon EKS Auth API and the AssumeRoleForPodIdentity
action are only used by the EKS Pod Identity Agent.
We recommend that applications use the Amazon Web Services SDKs to connect to Amazon Web Services services; if credentials from an EKS Pod Identity association are available in the pod, the latest versions of the SDKs use them automatically.
May throw AccessDeniedException.
May throw ExpiredTokenException.
May throw InternalServerException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw InvalidTokenException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter clusterName :
The name of the cluster for the request.
Parameter token :
The token of the Kubernetes service account for the pod.
Implementation
Future<AssumeRoleForPodIdentityResponse> assumeRoleForPodIdentity({
required String clusterName,
required String token,
}) async {
final $payload = <String, dynamic>{
'token': token,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/clusters/${Uri.encodeComponent(clusterName)}/assume-role-for-pod-identity',
exceptionFnMap: _exceptionFns,
);
return AssumeRoleForPodIdentityResponse.fromJson(response);
}