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): support customer managed key for event bus #30493

Merged
merged 9 commits into from
Jul 23, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented Jun 8, 2024

Issue # (if applicable)

N/A

Reason for this change

Amazon EventBridge supports Customer Managed Key for Event Bus since 2024/5.
But current L2 Construct does not support CMK.

For more information, see Amazon EventBridge now supports Customer Managed Keys (CMK) for Event Buses.

Description of changes

Add kmsKey property to the EventBus class

Description of how you validated changes

Add unit tests and integ tests.

Checklist


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

@github-actions github-actions bot added the admired-contributor [Pilot] contributed between 13-24 PRs to the CDK label Jun 8, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team June 8, 2024 12:06
@github-actions github-actions bot added the p2 label Jun 8, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 8, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍 Left suggestions for minor improvements

packages/aws-cdk-lib/aws-events/README.md Outdated Show resolved Hide resolved
new events.EventBus(this, 'Bus', {
kmsKey,
});
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be useful to add an extra note about archives and schema discovery not working with CMK (docs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.
I added the note.

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Events::EventBus', {
KmsKeyIdentifier: stack.resolve(key.keyArn),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please also add an assertion on the key policy?

Template.fromStack(stack).hasResourceProperties('AWS::KMS::Key', {
          KeyPolicy: {
            'Statement': [ ... ]
          }
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.
I added an assertion for the key policy.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 8, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 8, 2024

@lpizzinidev
Thank you for the review!
I'v addressed all your comments.

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍

packages/aws-cdk-lib/aws-events/README.md Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 9, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, two comments to address before I approve.

packages/aws-cdk-lib/aws-events/README.md Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 22, 2024
@mergify mergify bot dismissed GavinZZ’s stale review July 22, 2024 23:58

Pull request has been modified.

GavinZZ
GavinZZ previously approved these changes Jul 23, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

mergify bot commented Jul 23, 2024

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

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jul 23, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Jul 23, 2024

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/request-cli-integ-test.yml without workflows permission

@mergify mergify bot dismissed GavinZZ’s stale review July 23, 2024 00:35

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0950348
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 23, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jul 23, 2024

@GavinZZ
Thank you for the review. Could you please approve it again?

I merged main because the following error appeared:
This pull request cannot be embarked for merge​​​​​​​​​​​​​​​​

@mazyu36 mazyu36 requested a review from GavinZZ July 23, 2024 01:07
Copy link
Contributor

mergify bot commented Jul 23, 2024

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

@mergify mergify bot merged commit 8c44aa7 into aws:main Jul 23, 2024
15 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 23, 2024
@mazyu36 mazyu36 deleted the event-bus-kms branch July 23, 2024 01:34
obraafo pushed a commit to obraafo/aws-cdk that referenced this pull request Jul 25, 2024
### Issue # (if applicable)
N/A

### Reason for this change
Amazon EventBridge supports Customer Managed Key for Event Bus since 2024/5.
But current L2 Construct does not support CMK.

For more information, see [Amazon EventBridge now supports Customer Managed Keys (CMK) for Event Buses](https://aws.amazon.com/about-aws/whats-new/2024/05/amazon-eventbridge-cmk-event-buses/?nc1=h_ls).



### Description of changes
Add `kmsKey` property to the `EventBus` class


### Description of how you validated changes
Add unit tests and integ tests.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

1 similar comment
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants