Code Monkey home page Code Monkey logo

appstream-data-tools-isolation-blog's Introduction

appstream-data-tools-isolation-blog's People

Contributors

amazon-auto avatar clandau525 avatar fibert avatar jdbraun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xrusjohn

appstream-data-tools-isolation-blog's Issues

Unable to pickup Appstream active session in Lambda while executing from Userpool user

We had deployed the provided solution in our environment and observed an issue with UserPool user.

While executing the solution with custom user we could see Appstream describe session is able to generate active session Id in lambda function and able to start the sagemaker notebook successfully.

Observed an issue while executing with UserPool user as the lambda function describe-session is not able to generate active sessions and leads lambda to failure with below error

[ERROR] IndexError: list index out of range Traceback (most recent call last):
File "/var/task/data_sandbox_lambda.py", line 27, in lambda_handler
resp_user_session = resp['Sessions'][0]['Id']

Attached error files
Cloudwatch log shows both custom & userpool user

CW_logs

Active session logs from CLI.

AS_sessions

Thanks,
Pavan

Use a local installation of CDK V1 instead of global installation (npm install -g)

With CDK V2 becoming GA, it became the default CDK version installed when running the command npm install -g aws-cdk.

I suggest creating a package.json file that tells npm to locally install CDK with a specific version.

{
    "devDependencies": {
        "aws-cdk": "1.X.0"
    }
}

The commands used to run this solution would changed like so:

Change npm install -g aws-cdk to npm install.
Change cdk bootstrap to npx cdk bootstrap.
Change cdk deploy DataSandbox to npx cdk deploy DataSandbox.

data_sandbox_lambda Lambda function fails when the AppStream image name contains digits

I tried to deploy this solution and I encountered a problem that caused the data_sandbox_lambda Lambda function to fail at put_object with error:

[ERROR] NoSuchBucket: An error occurred (NoSuchBucket) when calling the PutObject operation: The specified bucket does not exist

How to reproduce:

At the image creation step, create an AppStream 2.0 image with digits in the name, for example my-image-00. Then continue as normal through the steps of deployment as described in the blog post.

Deeper dive into the problem:

I debugged it for a bit and found that in the session.json file, "bucketName" was:

appstream2-36fb080bb8-us-east-1-12345678901200

Where my account id would be 123456789012 (notice the trailing "00").

I searched for where these trailing zeros come from and found that in the sagemaker-notebook.ps1 powershell script, we get the account ID like so:

$ArnID = $env:AppStream_Image_Arn -replace "[^0-9]", ''
$AccountId = $ArnID.substring(1)

Which does not take into account digits in the image name, and would leave trailing digits in the account id if any are present.

Resolution

To overcome this problem I changed the two lines above to with this line:

$AccountId = $env:AppStream_Image_Arn.Split(":")[4]

Error with python dependencies

Description

When install the python dependencies using

pip install -r requirements.txt

I get the following error:

ERROR: Cannot install -r requirements.txt (line 11), -r requirements.txt (line 7) and aws-cdk.aws-s3-assets==1.51.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested aws-cdk.aws-s3-assets==1.51.0
    aws-cdk-aws-lambda 1.51.0 depends on aws-cdk.aws-s3-assets==1.51.0
    aws-cdk-aws-s3-deployment 1.50.0 depends on aws-cdk.aws-s3-assets==1.50.0

There is a conflict between aws-cdk-aws-lambda 1.51.0 and aws-cdk-aws-s3-deployment 1.50.0.

Upgrading aws-cdk-aws-s3-deployment 1.50.0 to aws-cdk-aws-s3-deployment 1.51.0 works, however after doing that, when deploying the CDK application I get to following error:

Embedded stack arn:aws:cloudformation:us-east-1:012345678901:stack/DataSandbox-appstreamservicerolesstackNestedStackappstreamservicerolesstackNestedStack-9D140RXJRAJN/2a1e76b0-c3b1-11ec-b6a2-12b935dbbaef was not successfully created: The following resource(s) failed to create: [LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A]. 

Resolution

To overcome this I upgraded all the aws-cdk* python packages to the current latest CDK V1 version: 1.153.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.