You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lambda): support Lambda's new Invoke with Qualifier authorization strategy (#19318)
‼️ Lambda is changing their authorization strategy, which means that some behavior that was previously valid now results in `access-denied` errors.
Under the new behavior, customer lambda invocations will fail if the CDK generates a policy with an unqualified ARN as the resource, and the customer invokes lambda with the unqualified ARN and the `Qualifier` request parameter.
Example of an affected setup:
```
Statement:
{
Effect: "Allow",
Action: "lambda:InvokeFunction",
Resource: "arn:aws:lambda:...:function:MyFunction",
}
API Call:
lambda.Invoke({
FunctionName: "MyFunction",
Qualifier: "1234",
})
```
This `Invoke` call *used* to succeed, but under the new authorization strategy it will fail. The required statement to make the call succeed would be (note the qualified ARN):
```
{
Effect: "Allow",
Action: "lambda:InvokeFunction",
Resource: "arn:aws:lambda:...:function:MyFunction:1234",
}
```
This PR aims to align the CDK with the new authorization strategy. The PR introduces changes to the `grantInvoke()` api on a lambda function. Now, when calling `grantInvoke()` on a lambda function, `[ARN, ARN:*]` is used in the identity policy, so that identities that are granted permission to invoke the Function may also invoke all of its Versions and Aliases.
When calling `grantInvoke()` on a lambda function Version or Alias, the generated identity policy will remain the same, and only include `ARN:<version/alias>` in the policy.
This is part of #19273
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
0 commit comments