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): archive events #12060

Merged
merged 9 commits into from
Feb 25, 2021
Merged

Conversation

DaWyz
Copy link
Contributor

@DaWyz DaWyz commented Dec 14, 2020

Add the possibility to archive events from an Event Bus. It's also possible to archive specific events by passing an event patterns. See the following blogpost for more information about event archiving and replay.

Archiving should be possible from an imported EventBus.

closes #11531


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 Dec 14, 2020

@github-actions github-actions bot added the @aws-cdk/aws-events Related to CloudWatch Events label Dec 14, 2020
@DaWyz
Copy link
Contributor Author

DaWyz commented Jan 5, 2021

Hi @shivlaks , any chance I could get a review for this ? Thanks !

@rix0rrr rix0rrr assigned rix0rrr and shivlaks and unassigned shivlaks Jan 13, 2021
packages/@aws-cdk/aws-events/lib/archive.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/event-bus.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed rix0rrr’s stale review January 14, 2021 05:38

Pull request has been modified.

@DaWyz DaWyz requested a review from rix0rrr January 14, 2021 06:40
@DaWyz
Copy link
Contributor Author

DaWyz commented Jan 27, 2021

@rix0rrr @shivlaks , any chance you could get another look at this ?

rix0rrr
rix0rrr previously requested changes Feb 9, 2021
*/
public abstract readonly eventSourceName?: string;

public archive(props: BaseArchiveProps): Archive {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please still add the id parameter.

public archive(props: BaseArchiveProps): Archive {
return new Archive(this, 'Archive', {
sourceEventBus: this,
description: props.description || Lazy.string({ produce: () => `Event Archive for ${this.eventBusName} Event Bus` }),
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be a Lazy.

eventBusName: 'MyCustomEventBus'
});

bus.archive(
Copy link
Contributor

Choose a reason for hiding this comment

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

Example needs braces { ... }.

sourceArn: props.sourceEventBus.eventBusArn,
description: props.description,
eventPattern: props.eventPattern,
retentionDays: props.retention?.toDays() || 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably want to pass { integral: true } to toDays() otherwise it may lead to values like 0.5.

@mergify mergify bot dismissed rix0rrr’s stale review February 10, 2021 02:56

Pull request has been modified.

@DaWyz DaWyz requested a review from rix0rrr February 10, 2021 04:22
@rix0rrr rix0rrr changed the title feat(aws-events): Add ability to archive events feat(events): archive events Feb 25, 2021
@mergify
Copy link
Contributor

mergify bot commented Feb 25, 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: b8fc828
  • 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 Feb 25, 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).

@mergify mergify bot merged commit 465cd9c into aws:master Feb 25, 2021
This was referenced Mar 8, 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.

[aws-events] Support AWS::Event::Archive
4 participants