Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 5c77502

Browse files
authored
Merge pull request #568 from aws-samples/fix/notebook-platform-roles
fix: return roles when adding users to notebook
2 parents d87633c + 00e6f87 commit 5c77502

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

core/API.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/notebook-platform/notebook-platform.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)