Skip to content

Commit 07fdb35

Browse files
committed
fix(pulumi-aws): sync system event bus
1 parent 2916744 commit 07fdb35

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/api-sync-system/__tests__/sync/createSendDataToEventBridgeOnRequestEnd.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ describe("createSendDataToEventBridgeOnRequestEnd", () => {
7575
expect(send).toHaveBeenCalledTimes(1);
7676
});
7777

78-
// TODO does not work
7978
it("should trigger flush on request end and get an unspecified error", async () => {
8079
const { request } = createMockRequest();
8180
const { reply } = createMockReply();

packages/api-sync-system/src/sync/handler/Handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export class Handler implements IHandler {
6060
console.log(JSON.stringify({ entries }));
6161

6262
const input: PutEventsCommandInput = {
63-
Entries: entries,
63+
Entries: entries
6464
/**
6565
* If we get to the global event bus usage, we will need to set the EndpointId
6666
*/
67-
EndpointId: undefined
67+
// EndpointId: undefined
6868
};
6969
const command = new PutEventsCommand(input);
7070

packages/pulumi-aws/src/apps/syncSystem/SyncSystemEventBus.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const SyncSystemEventBus = createAppModule({
2424
});
2525

2626
const eventBusRuleConfig: EventRuleArgs = {
27-
eventBusName: eventBus.output.arn,
27+
eventBusName: eventBus.output.name,
2828
eventPattern: JSON.stringify({
2929
"detail-type": ["synchronization-input"]
3030
})
@@ -56,7 +56,7 @@ export const SyncSystemEventBus = createAppModule({
5656
const eventBusPolicy = app.addResource(aws.sqs.QueuePolicy, {
5757
name: createSyncResourceName("queuePolicy"),
5858
config: {
59-
queueUrl: sqs.output.id,
59+
queueUrl: sqs.output.url,
6060
policy: sqs.output.arn.apply(arn => {
6161
return JSON.stringify({
6262
Version: "2012-10-17",
@@ -65,7 +65,7 @@ export const SyncSystemEventBus = createAppModule({
6565
Effect: "Allow",
6666
Principal: aws.iam.Principals.EventsPrincipal,
6767
Action: "sqs:SendMessage",
68-
Resource: arn,
68+
Resource: [arn, `${arn}/*`],
6969
Condition: {
7070
ArnEquals: {
7171
"aws:SourceArn": eventBusRule.output.arn

0 commit comments

Comments
 (0)