Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using AWS CDK with Deno #24291

Open
felipefdl opened this issue Jun 20, 2024 · 0 comments
Open

Problem using AWS CDK with Deno #24291

felipefdl opened this issue Jun 20, 2024 · 0 comments
Labels
bug Something isn't working correctly node compat

Comments

@felipefdl
Copy link

History:

I'm trying to create a Lambda function on AWS using CDK, and I'm using Deno for this purpose. Every other service is working well, but this specific Lambda function is not. The CDK starts but never deploys it; it just freezes. The problem lies in the following line of code:

lambda.Code.fromAsset("path/of/code")

If I change this to use ImageDocker for the Lambda, it works. However, in this case, I need to use this function because I've already built the Lambda code (it's using cargo-lambda for Rust).

I reverted to Node.js, and it worked fine. I tried downgrading and upgrading Deno, clearing the cache, changing the version of CDK, and nothing worked. This is a big CDK project, and everything else is working except for this part.

Snippet of code:

const fn = new lambda.Function(queueStack, "lambda-digest", {
  functionName: `my_function`,
  runtime: lambda.Runtime.PROVIDED_AL2,
  code: lambda.Code.fromAsset("path/of/code"),
  handler: "bootstrap",
  timeout: Duration.seconds(60),
  retryAttempts: 2,
  architecture: lambda.Architecture.ARM_64,
  memorySize: 128,
  maxEventAge: Duration.hours(6),
  environment: {
    TIMEOUT: String(60),
    DATE_IDENTIFIER: new Date().toISOString().split("T")[0],
  },
});

Deno details:

$ deno --version
deno 1.44.4 (release, aarch64-apple-darwin)
v8 12.6.228.9
typescript 5.4.5

Deno.json

{
  "imports": {
    "aws-cdk-lib": "npm:aws-cdk-lib@2",
    "path": "jsr:@std/path@0.225.2"
  }
}
@lucacasonato lucacasonato added bug Something isn't working correctly node compat labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

2 participants