CDK: put aws apigateway events on to default bus in EventBridge

0

As I understand in order to put events on to the default bus, I need to associate/create a role with PutEvents permission. How can I do that in cdk to put aws apigateway events on to default bus. Thanks

1 Answer
1

To add additional permissions to you function use the addToRolePolicy method.

As a basic example for EventBridge.

myFunction.addToRolePolicy(new iam.PolicyStatement({ 
      actions: ['events:PutEvents'],
      resources: ['*'],
    }))
AWS
Marco
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions