Skip to content

Commit 9c2712c

Browse files
committed
renaming method
1 parent 2a06e42 commit 9c2712c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/@aws-cdk/aws-events/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ bus.archive('MyArchive', {
192192
To import an existing EventBus into your CDK application, use `EventBus.fromEventBusArn` or `EventBus.fromEventBusAttributes`
193193
factory method.
194194

195-
Then, you can use the `grantPut` method to grant `event:PutEvents` to the eventBus.
195+
Then, you can use the `grantPutEventsTo` method to grant `event:PutEvents` to the eventBus.
196196

197197
```ts
198198
const eventBus = EventBus.fromEventBusArn(this, 'ImportedEventBus', 'arn:aws:events:us-east-1:111111111:event-bus/my-event-bus');
199199

200200
// now you can just call methods on the eventbus
201-
eventBus.grantPut(lambdaFunction);
202-
```
201+
eventBus.grantPutEventsTo(lambdaFunction);
202+
```

packages/@aws-cdk/aws-events/lib/event-bus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface IEventBus extends IResource {
5454
*
5555
* @param grantee The principal (no-op if undefined)
5656
*/
57-
grantPut(grantee: iam.IGrantable): iam.Grant;
57+
grantPutEventsTo(grantee: iam.IGrantable): iam.Grant;
5858
}
5959

6060
/**
@@ -146,7 +146,7 @@ abstract class EventBusBase extends Resource implements IEventBus {
146146
});
147147
}
148148

149-
public grantPut(grantee: iam.IGrantable): iam.Grant {
149+
public grantPutEventsTo(grantee: iam.IGrantable): iam.Grant {
150150
return iam.Grant.addToPrincipal({
151151
grantee,
152152
actions: ['events:PutEvents'],

packages/@aws-cdk/aws-events/test/test.event-bus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export = {
257257
const eventBus = new EventBus(stack, 'EventBus');
258258

259259
// WHEN
260-
eventBus.grantPut(role);
260+
eventBus.grantPutEventsTo(role);
261261

262262
// THEN
263263
expect(stack).to(haveResource('AWS::IAM::Policy', {

packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class EventBridgeDestination implements lambda.IDestination {
2222
* Returns a destination configuration
2323
*/
2424
public bind(_scope: Construct, fn: lambda.IFunction, _options?: lambda.DestinationOptions): lambda.DestinationConfig {
25-
this.eventBus.grantPut(fn);
25+
this.eventBus.grantPutEventsTo(fn);
2626

2727
return {
2828
destination: this.eventBus && this.eventBus.eventBusArn || Stack.of(fn).formatArn({

0 commit comments

Comments
 (0)