Skip to content

test(lambda): add direct coverage for grantInvokeLatestVersion resource grants#37487

Draft
pirothat wants to merge 1 commit intoaws:mainfrom
pirothat:add-test-case-for-latest-lambda
Draft

test(lambda): add direct coverage for grantInvokeLatestVersion resource grants#37487
pirothat wants to merge 1 commit intoaws:mainfrom
pirothat:add-test-case-for-latest-lambda

Conversation

@pirothat
Copy link
Copy Markdown
Contributor

@pirothat pirothat commented Apr 1, 2026

Issue # (if applicable)

N/A

Reason for this change

Add a unit test for grantInvokeLatestVersion().

to invoke the latest version or the unqualified Lambda ARN, use grantInvokeLatestVersion(grantee)

Lambda README:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html

This behavior is part of the API contract and is worth pinning directly in a
unit test.

Description of changes

Verify that the synthesized IAM policy grants lambda:InvokeFunction with
Effect: Allow for both:

  • the unqualified function ARN
  • the $LATEST qualified ARN

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Added a regression unit test for grantInvokeLatestVersion() in packages/aws-cdk-lib/aws-lambda/test/function.test.ts.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Apr 1, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 1, 2026 11:55
@pirothat pirothat marked this pull request as draft April 1, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant