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

[aws-events] Support AWS::Event::Archive #11531

Assignees
Labels
@aws-cdk/aws-events Related to CloudWatch Events effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@baxang
Copy link
Contributor

baxang commented Nov 18, 2020

The package https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-events does not have Archive which was recently added.

Use Case

The resources are

Proposed Solution

I propose implementing constructs for the aforementioned resources. The implemented construct would look like:

const eventBus = new events.EventBus(this, 'MyEventBus', { eventBusName: 'my-event-bus' });
new events.Archive(this, 'EventArchive', {
  description: string,
  eventBus: eventBus,
  retention: cdk.Duration.days(10),
  eventPattern: { /* JSON */ },
});

Meanwhile, there's a workaround using cdk.CfnResource as the CDK documentation suggests

new cdk.CfnResource(this, 'EventArchive', {
      type: 'AWS::Events::Archive',
      RetentionDays: 30,
      SourceArn: `arn:aws:events:${this.region}:${this.account}:event-bus/default`
});

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@baxang baxang added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 18, 2020
@github-actions github-actions bot added the @aws-cdk/aws-events Related to CloudWatch Events label Nov 18, 2020
@DaWyz
Copy link
Contributor

DaWyz commented Nov 22, 2020

We could also add an archive method on the EventBus itself (and available as part of the IEventBus interface since it's a separate resource and could be added on an imported resource) since it's the only resource it can be applied to.

const eventBus = new events.EventBus(this, 'MyEventBus', { eventBusName: 'my-event-bus' });

eventBus.archive({
  description?: string, // Should have a generated default
  retention: cdk.Duration.days(10), // Should have a default retention
  eventPattern: { /* JSON */ },
});

@shivlaks shivlaks added p1 effort/medium Medium work item – several days of effort labels Dec 17, 2020
@SomayaB SomayaB added p1 and removed p1 needs-triage This issue or PR still needs to be triaged. labels Dec 17, 2020
@NGL321 NGL321 assigned rix0rrr and unassigned shivlaks Jan 25, 2021
@mergify mergify bot closed this as completed in #12060 Feb 25, 2021
mergify bot pushed a commit that referenced this issue Feb 25, 2021
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](https://aws.amazon.com/blogs/aws/new-archive-and-replay-events-with-amazon-eventbridge/) 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*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment