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

NotebookPlatform construct potentially building resources ID with tokens #570

Open
vgkowski opened this issue Feb 2, 2023 · 0 comments
Open
Labels
emr eks Components used in EMR on EKS abstractions enhancement New feature or request good first issue Good for newcomers

Comments

@vgkowski
Copy link
Collaborator

vgkowski commented Feb 2, 2023

The method addUser() in the NotebookPlatformconstruct is using the identity_name parameter in some resources ID. If the username is a token that is resolved at deploy time, CDK fails.

Here is a typical example that is failing:

    notebook_user = iam.User(self, 'NotebookUser', user_name='my-user')

    # Notebook to user association
    exec_roles = notebook_platform.add_user([ara.NotebookUserOptions(
        identity_name=notebook_user.user_name,
        notebook_managed_endpoints=[ ara.NotebookManagedEndpointOptions(
            emr_on_eks_version= ara.EmrVersion.V6_9,
            execution_policy= exec_policy,
            managed_endpoint_name="test"
        )])
    ])

Workaround: replace the identity_name value by the actual name you provide to the User construct and add a CDK node dependency between them

    notebook_user = iam.User(self, 'NotebookUser', user_name='my-user')

    # Notebook to user association
    exec_roles = notebook_platform.add_user([ara.NotebookUserOptions(
        identity_name='my-user',
        notebook_managed_endpoints=[ ara.NotebookManagedEndpointOptions(
            emr_on_eks_version= ara.EmrVersion.V6_9,
            execution_policy= exec_policy,
            managed_endpoint_name="test"
        )])
    ])

    # Get the Role created by the notebook platform
    exec_role=exec_roles[0]

    exec_role.node.add_dependency(notebook_user)
@vgkowski vgkowski added enhancement New feature or request good first issue Good for newcomers emr eks Components used in EMR on EKS abstractions labels Feb 2, 2023
@vgkowski vgkowski reopened this May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emr eks Components used in EMR on EKS abstractions enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant