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 個回答
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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南