-
Couldn't load subscription status.
- Fork 4.3k
Closed
Labels
@aws-cdk/triggersRelated to the triggers packageRelated to the triggers packagebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortin-progressThis issue is being actively worked on.This issue is being actively worked on.p2
Description
Related to #19272
Describe the bug
When using the Trigger construct, it only has permissions to invoke a single lambda function, meaning it cannot invoke more than one without receiving an access denied error.
Expected Behavior
Both lambda functions are invoked.
Current Behavior
Access denied exception
Reproduction Steps
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as triggers from 'aws-cdk-lib/triggers';
...
new triggers.TriggerFunction(this, 'One', {
runtime: lambda.Runtime.NODEJS_16_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function() { console.log("One"); };'),
});
new triggers.TriggerFunction(this, 'Two', {
runtime: lambda.Runtime.NODEJS_16_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function() { console.log("Two"); };'),
});Possible Solution
The CustomResourceProvider should use addToRolePolicy rather than creating the policy in the constructor
Additional Information/Context
No response
CDK CLI Version
2.42.0
Framework Version
No response
Node.js Version
16.15.0
OS
Mac OS
Language
Typescript
Language Version
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
@aws-cdk/triggersRelated to the triggers packageRelated to the triggers packagebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortin-progressThis issue is being actively worked on.This issue is being actively worked on.p2