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(aws-events): add EventBus construct #4609

Merged
merged 2 commits into from
Oct 29, 2019
Merged

feat(aws-events): add EventBus construct #4609

merged 2 commits into from
Oct 29, 2019

Conversation

dehli
Copy link
Contributor

@dehli dehli commented Oct 21, 2019

Hello,

In this PR I've added the EventBus resource which is a L2 construct of CfnEventBus. There are three ways that you can create an EventBus and they are:

// Auto-generate the event bus name 
new EventBus(scope, id);

// Explicitly give it a name
new EventBus(scope, id, { eventBusName: "myBus" });

// Create a partner bus
new EventBus(scope, id, { eventSourceName: "aws.partner/Account/partner" });

Note: I didn't add the IEventBus to the Rule resource because the current CloudFormation spec doesn't allow you to specify an EventBusName on a Rule (even though that is valid CF). My thoughts are that it can be addressed in a separate PR once the spec is updated again.

Known Remaining Tasks

  • Update README.md
  • Document code

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

@dehli dehli requested a review from eladb as a code owner October 21, 2019 17:47
@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@dehli dehli mentioned this pull request Oct 22, 2019
4 tasks
packages/@aws-cdk/aws-events/lib/base-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/base-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/base-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/base-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/base-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/lib/custom-event-bus.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-events/package.json Outdated Show resolved Hide resolved
@dehli
Copy link
Contributor Author

dehli commented Oct 23, 2019

Thanks @rix0rrr for the review! I'll address your feedback and follow up.

@dehli dehli changed the title feat(aws-events): CustomEventBus and PartnerEventBus (in progress) feat(aws-events): EventBus (in progress) Oct 23, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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


constructor(scope: Construct, id: string, props?: EventBusProps) {
const { eventBusName, eventSourceName } = EventBus.eventBusProps(
Lazy.stringValue({ produce: () => this.node.uniqueId }),
Copy link
Contributor Author

@dehli dehli Oct 23, 2019

Choose a reason for hiding this comment

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

Will this generate a unique id across stacks? I could prefix with Aws.STACK_NAME if not but I didn't see that being done in code anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it will be unique.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@dehli dehli changed the title feat(aws-events): EventBus (in progress) feat(aws-events): EventBus Oct 24, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Adds the L2 resource for `CfnEventBus`
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • 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 Oct 29, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@rix0rrr rix0rrr changed the title feat(aws-events): EventBus feat(aws-events): add EventBus construct Oct 29, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit bbec8c5 into aws:master Oct 29, 2019
@dehli dehli deleted the event-bus branch November 3, 2019 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants