@@ -358,7 +358,7 @@ export class NotebookPlatform extends TrackedConstruct {
358358
359359 let iamRolePolicy : ManagedPolicy ;
360360
361- let iamUserList : string [ ] = [ ] ;
361+ let iamRoleList : Role [ ] = [ ] ;
362362
363363 //Loop through each user and create its managed endpoint(s) as defined by the user
364364 for ( let user of userList ) {
@@ -373,20 +373,22 @@ export class NotebookPlatform extends TrackedConstruct {
373373
374374 let emrOnEksVersion : EmrVersion | undefined = user . notebookManagedEndpoints [ index ] . emrOnEksVersion ;
375375 let configOverride : string | undefined = user . notebookManagedEndpoints [ index ] . configurationOverrides ;
376+ let execRole = this . emrEks . createExecutionRole (
377+ this ,
378+ `${ user . identityName } ${ index } ` ,
379+ notebookManagedEndpoint . executionPolicy ,
380+ this . vcNamespace ,
381+ `${ notebookManagedEndpoint . managedEndpointName } -execRole` ,
382+ ) ;
383+ iamRoleList . push ( execRole ) ;
376384
377385 let managedEndpoint = this . emrEks . addManagedEndpoint (
378386 this ,
379387 `${ this . studioName } ${ Utils . stringSanitizer ( notebookManagedEndpoint . managedEndpointName ) } ` ,
380388 {
381389 managedEndpointName : `${ this . studioName } -${ notebookManagedEndpoint . managedEndpointName } ` ,
382390 virtualClusterId : this . emrVirtCluster . attrId ,
383- executionRole : this . emrEks . createExecutionRole (
384- this ,
385- `${ user . identityName } ${ index } ` ,
386- notebookManagedEndpoint . executionPolicy ,
387- this . vcNamespace ,
388- `${ notebookManagedEndpoint . managedEndpointName } -execRole` ,
389- ) ,
391+ executionRole : execRole ,
390392 emrOnEksVersion : emrOnEksVersion ? emrOnEksVersion : NotebookPlatform . DEFAULT_EMR_VERSION ,
391393 configurationOverrides : configOverride ? configOverride : undefined ,
392394 } ,
@@ -463,6 +465,6 @@ export class NotebookPlatform extends TrackedConstruct {
463465 }
464466 }
465467
466- return iamUserList ;
468+ return iamRoleList ;
467469 }
468470}
0 commit comments