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-autoscaling): Lambda autoscaling example uses an alias to latestVersion, which doesn't work #19103

Closed
schipono opened this issue Feb 23, 2022 · 3 comments
Assignees
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@schipono
Copy link

link to reference doc page

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.AutoScalingOptions.html

Describe your issue?

When following the example in the docs to setup auto-scaling provisioned concurrency on a lambda function, the docs explicitly state in the example to first add an alias on the lambda function's latestVersion. I followed the example, setup an alias to latestVersion, added a basic scaleOnUtilization target, and then deployed the stack. The deploy went through without errors.

After deploy, I checked the lambda in the AWS Console and noticed there was no provisioned concurrency setup for it. I drilled down into the alias associated with the lambda that I created from the example and promptly saw:

image

Did I misunderstand something in the docs or is this a bad example? Looking at the docs for Version I see it's example uses the Function method addVersion - and the addVersion method docs tell me is deprecated and points me to use function.currentVersion. If this is not a misunderstanding on my part, can these be updated to whatever the current best practice for setting up basic provisioned concurrency auto-scaling on the most recently deployed lambda version is?

@schipono schipono added documentation This is a problem with documentation. feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2022
@github-actions github-actions bot added the @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling label Feb 23, 2022
@peterwoodworth
Copy link
Contributor

This is how it looks in the readme https://github.com/aws/aws-cdk/blob/v1.159.0/packages/%40aws-cdk/aws-lambda/README.md#autoscaling

This is just a bad example. The integration test linked right below has a good example. Would you be willing to help us fix this up? Check out our contributing guide to get started.

@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. labels Jun 4, 2022
@kaizencc kaizencc self-assigned this Jun 10, 2022
@kaizencc
Copy link
Contributor

This was fixed by #20034

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

No branches or pull requests

4 participants