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

fix(events): simplify the cache key for cross-account targets #3526

Merged
merged 2 commits into from
Aug 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/@aws-cdk/aws-events/lib/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ export class Rule extends Resource implements IRule {
}

// the _actual_ target is just the event bus of the target's account
// make sure we only add it once per region
const key = `${targetAccount}-${targetRegion}`;
const exists = this.accountEventBusTargets[key];
// make sure we only add it once per account
const exists = this.accountEventBusTargets[targetAccount];
if (!exists) {
this.accountEventBusTargets[key] = true;
this.accountEventBusTargets[targetAccount] = true;
this.targets.push({
id,
arn: targetStack.formatArn({
Expand Down