Skip to content

Commit

Permalink
Topic: fix queue subscription updating w/o changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Oct 2, 2024
1 parent 64a591a commit 2ed86c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion platform/src/components/aws/sns-topic-lambda-subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ComponentResourceOptions,
Input,
jsonStringify,
Output,
output,
} from "@pulumi/pulumi";
Expand Down Expand Up @@ -88,7 +89,7 @@ export class SnsTopicLambdaSubscriber extends Component {
topic: topic.arn,
protocol: "lambda",
endpoint: fn.arn,
filterPolicy: JSON.stringify(args.filter ?? {}),
filterPolicy: args.filter && jsonStringify(args.filter),
},
{ parent: self, dependsOn: [permission] },
),
Expand Down
9 changes: 7 additions & 2 deletions platform/src/components/aws/sns-topic-queue-subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ComponentResourceOptions, Input, output } from "@pulumi/pulumi";
import {
ComponentResourceOptions,
Input,
jsonStringify,
output,
} from "@pulumi/pulumi";
import { Component, transform } from "../component";
import { SnsTopicSubscriberArgs } from "./sns-topic";
import { parseQueueArn } from "./helpers/arn";
Expand Down Expand Up @@ -81,7 +86,7 @@ export class SnsTopicQueueSubscriber extends Component {
topic: topic.arn,
protocol: "sqs",
endpoint: queueArn,
filterPolicy: JSON.stringify(args.filter ?? {}),
filterPolicy: args.filter && jsonStringify(args.filter),
},
{},
),
Expand Down
2 changes: 1 addition & 1 deletion platform/src/components/aws/sns-topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export class SnsTopic extends Component implements Link.Linkable {
[
typeof topicArn === "string" ? topicArn : outputId,
JSON.stringify(args.filter ?? {}),
typeof queueArn === "string" ? queueArn : outputId,
queueArn,
].join(""),
6,
),
Expand Down

0 comments on commit 2ed86c7

Please sign in to comment.