associateRoleToGroup method

Future<AssociateRoleToGroupResponse> associateRoleToGroup({
  1. required String groupId,
  2. required String roleArn,
})

Associates a role with a group. Your Greengrass core will use the role to access AWS cloud services. The role's permissions should allow Greengrass core Lambda functions to perform actions against the cloud.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter groupId : The ID of the Greengrass group.

Parameter roleArn : The ARN of the role you wish to associate with this group. The existence of the role is not validated.

Implementation

Future<AssociateRoleToGroupResponse> associateRoleToGroup({
  required String groupId,
  required String roleArn,
}) async {
  ArgumentError.checkNotNull(groupId, 'groupId');
  ArgumentError.checkNotNull(roleArn, 'roleArn');
  final $payload = <String, dynamic>{
    'RoleArn': roleArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/greengrass/groups/${Uri.encodeComponent(groupId)}/role',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateRoleToGroupResponse.fromJson(response);
}