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

(@aws-cdk/aws-lambda): layers property and addLayer() DockerLayerStack construct #27666

Open
annguyen36 opened this issue Oct 24, 2023 · 1 comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda documentation This is a problem with documentation. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@annguyen36
Copy link

Hello team,

Main issue: Lambda functions packaged as container images do not support adding Lambda layers to the function configuration, but CDK docs lists layers property as one of DockerLayerStack's valid props and addLayer() is valid method.

From this closed issue: #14143
although there is an error added to the synthesis step when creating container function with layers, I found the issue with addLayer() method when trying to add the layer to the container function, it was passed the synthesize step and failed at stack deployment:

❌ Deployment failed: Error: The stack named DockerLayerStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "Please don't provide Handler or Runtime or Layer when the intended function PackageType is Image. (Service: Lambda, Status Code: 400)" HandlerErrorCode: InvalidRequest)

What did you expect to have

doc: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.DockerImageFunction.html#addwbrlayerslayers

If the layers property is not able to used to add layer to the DockerImageFunction construct, as well as the addLayer() method as this is something Lambda not support, I'm expecting these 2 are not listed in CDK documentation.

This creates a lot of confusion, please consider to revise this doc.

Originally posted by @annguyen36 in #14143 (comment)

@sdpoueme
Copy link

@annguyen36 Thanks for filing this. I am working on a similar problem. I think the issue need to be labeled as bug and triage to be visible in the queue.

@tim-finnigan tim-finnigan added p2 feature-request A feature should be added or improved. @aws-cdk/aws-lambda Related to AWS Lambda documentation This is a problem with documentation. effort/medium Medium work item – several days of effort labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda documentation This is a problem with documentation. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants