createStudioSessionMapping method
Maps a user or group to the Amazon EMR Studio specified by
StudioId, and applies a session policy to refine Studio
permissions for that user or group. Use
CreateStudioSessionMapping to assign users to a Studio when
you use IAM Identity Center authentication. For instructions on how to
assign users to a Studio when you use IAM authentication, see Assign
a user or group to your EMR Studio.
May throw InternalServerError.
May throw InvalidRequestException.
Parameter identityType :
Specifies whether the identity to map to the Amazon EMR Studio is a user
or a group.
Parameter sessionPolicyArn :
The Amazon Resource Name (ARN) for the session policy that will be applied
to the user or group. You should specify the ARN for the session policy
that you want to apply, not the ARN of your user role. For more
information, see Create
an Amazon EMR Studio User Role with Session Policies.
Parameter studioId :
The ID of the Amazon EMR Studio to which the user or group will be mapped.
Parameter identityId :
The globally unique identifier (GUID) of the user or group from the IAM
Identity Center Identity Store. For more information, see UserId
and GroupId
in the IAM Identity Center Identity Store API Reference. Either
IdentityName or IdentityId must be specified,
but not both.
Parameter identityName :
The name of the user or group. For more information, see UserName
and DisplayName
in the IAM Identity Center Identity Store API Reference. Either
IdentityName or IdentityId must be specified,
but not both.
Implementation
Future<void> createStudioSessionMapping({
required IdentityType identityType,
required String sessionPolicyArn,
required String studioId,
String? identityId,
String? identityName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.CreateStudioSessionMapping'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'IdentityType': identityType.value,
'SessionPolicyArn': sessionPolicyArn,
'StudioId': studioId,
if (identityId != null) 'IdentityId': identityId,
if (identityName != null) 'IdentityName': identityName,
},
);
}