@@ -358,7 +358,7 @@ export class NotebookPlatform extends TrackedConstruct {
358
358
359
359
let iamRolePolicy : ManagedPolicy ;
360
360
361
- let iamUserList : string [ ] = [ ] ;
361
+ let iamRoleList : Role [ ] = [ ] ;
362
362
363
363
//Loop through each user and create its managed endpoint(s) as defined by the user
364
364
for ( let user of userList ) {
@@ -373,20 +373,22 @@ export class NotebookPlatform extends TrackedConstruct {
373
373
374
374
let emrOnEksVersion : EmrVersion | undefined = user . notebookManagedEndpoints [ index ] . emrOnEksVersion ;
375
375
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 ) ;
376
384
377
385
let managedEndpoint = this . emrEks . addManagedEndpoint (
378
386
this ,
379
387
`${ this . studioName } ${ Utils . stringSanitizer ( notebookManagedEndpoint . managedEndpointName ) } ` ,
380
388
{
381
389
managedEndpointName : `${ this . studioName } -${ notebookManagedEndpoint . managedEndpointName } ` ,
382
390
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 ,
390
392
emrOnEksVersion : emrOnEksVersion ? emrOnEksVersion : NotebookPlatform . DEFAULT_EMR_VERSION ,
391
393
configurationOverrides : configOverride ? configOverride : undefined ,
392
394
} ,
@@ -463,6 +465,6 @@ export class NotebookPlatform extends TrackedConstruct {
463
465
}
464
466
}
465
467
466
- return iamUserList ;
468
+ return iamRoleList ;
467
469
}
468
470
}
0 commit comments