maskaravivek/cdk-samples

Getting an error with one package

Opened this issue · 0 comments

I tried both the packages and was able to successfully install this one:

Docker + Lambda + Api Gateway
Code: aws-cdk-docker-lambda-api-gateway/

This works really well and I appreciate making it so user-friendly.
How do I remove all resources created by the above script? Removing the stack is sufficient?


But when I tried the second code, I got an error.

S3 authorizer Lambda + API Gateway
Code: aws-cdk-s3-lambda-api-gateway/

(base) root@ip-172-31-38-54:/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway# cdk deploy

/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/@aws-cdk/core/lib/asset-staging.ts:113
      throw new Error(`Cannot find asset at ${this.sourcePath}`);
            ^
Error: Cannot find asset at /home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/lambda/s3-authorizer
    at new AssetStaging (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/@aws-cdk/core/lib/asset-staging.ts:113:13)
    at new Asset (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/@aws-cdk/aws-s3-assets/lib/asset.ts:68:21)
    at AssetCode.bind (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/@aws-cdk/aws-lambda/lib/code.ts:180:20)
    at new Function (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/@aws-cdk/aws-lambda/lib/function.ts:327:29)
    at new AwsCdkS3LambdaApiGatewayStack (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/lib/aws-cdk-s3-lambda-api-gateway-stack.ts:23:26)
    at Object.<anonymous> (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/bin/aws-cdk-s3-lambda-api-gateway.ts:6:1)
    at Module._compile (node:internal/modules/cjs/loader:1246:14)
    at Module.m._compile (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/ts-node/src/index.ts:1056:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
    at Object.require.extensions.<computed> [as .ts] (/home/ubuntu/mylambda/cdk-samples/aws-cdk-s3-lambda-api-gateway/node_modules/ts-node/src/index.ts:1059:12)

Subprocess exited with error 1