Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(events): EventBus.grantPutEventsTo method for granular grants #13429

Merged
merged 7 commits into from
Mar 9, 2021

Conversation

DaWyz
Copy link
Contributor

@DaWyz DaWyz commented Mar 6, 2021

Right now EventBus has a static method grantPutEvents() which grants PutEvents to all EventBridge buses in the account.

Adding a grantPutEventsTo() method to the IEventBus interface that grants PutEvents to the specific event bus.
We are also deprecating grantPutEvents() in favor to grantAllPutEvents() which has the same behavior.

Closes #11228.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Mar 6, 2021

@github-actions github-actions bot added the @aws-cdk/aws-events Related to CloudWatch Events label Mar 6, 2021
@DaWyz DaWyz force-pushed the DaWyz/event-bus-grant-putevents branch from 8709cb9 to 9c2712c Compare March 6, 2021 02:17
*
* @param grantee The principal (no-op if undefined)
*/
grantPutEventsTo(grantee: iam.IGrantable): iam.Grant;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grantPutEvents is already taken by the static method. Should I drop the static method and rename this ? (That would be a breaking change..)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolving as this a stable module and the contributing guide says no breaking changes on stable modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yap, that is unfortunate.

Can I ask you to, in this same commit, to @deprecate the current grantPutEvents and add a new one that's called grantAllPutEvents as well?

Then we are set up to rename this to grantPutEvents at some point in the future once we've removed deprecated APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. It's done ! Ready for review

@DaWyz DaWyz force-pushed the DaWyz/event-bus-grant-putevents branch from 9c2712c to 6533ffa Compare March 6, 2021 20:23
rix0rrr
rix0rrr previously requested changes Mar 8, 2021
*
* @param grantee The principal (no-op if undefined)
*/
grantPutEventsTo(grantee: iam.IGrantable): iam.Grant;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yap, that is unfortunate.

Can I ask you to, in this same commit, to @deprecate the current grantPutEvents and add a new one that's called grantAllPutEvents as well?

Then we are set up to rename this to grantPutEvents at some point in the future once we've removed deprecated APIs.

@mergify mergify bot dismissed rix0rrr’s stale review March 9, 2021 01:04

Pull request has been modified.

@DaWyz DaWyz changed the title feat(events): add grantPut to eventBus construct feat(events): add grantPutEventsTo method to IEventBus construct Mar 9, 2021
@rix0rrr rix0rrr changed the title feat(events): add grantPutEventsTo method to IEventBus construct feat(events): EventBus.grantPutEventsTo method for granular grants Mar 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: de11488
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

This was referenced Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events Related to CloudWatch Events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[events] Grant events:PutEvents to specific EventBridge bus
3 participants