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

Public ARN of aws-otel-nodejs-amd64 v1.18.1 is too large #871

Open
mt-jmccarthy opened this issue Feb 29, 2024 · 0 comments
Open

Public ARN of aws-otel-nodejs-amd64 v1.18.1 is too large #871

mt-jmccarthy opened this issue Feb 29, 2024 · 0 comments

Comments

@mt-jmccarthy
Copy link


name: Bug report
about: Create a report to help us improve
title: 'Public ARN of aws-otel-nodejs-amd64 v1.18.1 is too large'
labels: bug
assignees: ''


Describe the bug
Using the public ARN of the aws-otel-nodejs v1.18.1 lambda layer results in AWS CDK deployment failure due to the lambda layer being too large.

Steps to reproduce

  • Create an application stack in AWS CDK (v2.125.0)
  • Create a reference to the public lambda layer using the ARN arn:aws:lambda:ap-northeast-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-18-1:1
  • Attach that lambda layer reference to a defined lambda function.
  • Deploy the application using the AWS CDK command (npx aws-cdk deploy appName)

Sample code

// Typescript (4.9.5)
const getOtelCollectorLayer = (scope: Stack): LayerVersion => {
  return LayerVersion.fromLayerVersionArn(
    scope,
    `OtelCollectorLayer`,
    `arn:aws:lambda:${scope.region}:901920570463:layer:aws-otel-nodejs-amd64-ver-1-18-1:1`
  );
};

export const buildParserHandler = (scope: Stack): Function => {

  const otelLayer = getOtelCollectorLayer(scope);
  
  return new Function(scope, `MyLambdaFunction`, {
    runtime: Runtime.NODEJS_18_X,
    handler: "index.handler",
    memorySize: 256,
    timeout: Duration.seconds(60),
    code: Code.fromAsset(path.join("dist/")),
    layers: [otelLayer],
    functionName: `my-lambda-function}`,
  });
  
};

What did you expect to see?
A successful deployment of the application stack.

What did you see instead?
Deployment fails due to an error contianing:
Resource handler returned message: "Layers consume more than the available size of 262144000 bytes

What version of collector/language SDK version did you use?
Nodejs v1.18.1

What language layer did you use?
Node v18.16.0

Additional context

  • I tested deployments with layer version v1.12.0 and v1.17.1, and both deployed successfully. Only v1.18.1 gives me the deployment error.
  • There is a known issue with AWS CDK where replacing an existing lambda layer with a new version may cause this error. To work around this, I first deployed a stack where there is no lambda layers, then did another deployment with lambda layer v1.18.1. It still resulted in the same error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant