Hubert
02/01/2022, 4:18 PMError: A subscription with id "Topic" already exists under the scope dev-*-metadata-stack/UpdateSnapshot
at Topic.addSubscription (/home/dev/Documents/*/Github/*/node_modules/aws-cdk-lib/aws-sns/lib/topic-base.ts:61:13)
at Topic.addFunctionSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:231:19)
at Topic.addSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:176:12)
at /home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:46
at Array.forEach (<anonymous>)
at Topic.addSubscribers (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:17)
at new MetadataStack (/home/dev/Documents/*/Github/*/lib/metadataStack.js:231:22)
at Object.main (/home/dev/Documents/*/Github/*/lib/index.js:125:39)
at Object.<anonymous> (/home/dev/Documents/*/Github/*/.build/run.js:94:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Any ideas of a work around? Thanks!thdxr
02/01/2022, 4:30 PMthdxr
02/01/2022, 4:30 PMHubert
02/01/2022, 4:35 PMprops.topicA.addSubscribers(this, [
{
function: updateSnapshot,
subscriberProps: {
filterPolicy: {
event_type: SubscriptionFilter.stringFilter({
allowlist: ["file_created"],
}),
},
},
},
]);
props.topicB.addSubscribers(this, [
{
function: updateSnapshot,
subscriberProps: {
filterPolicy: {
event_type: SubscriptionFilter.stringFilter({
allowlist: ["state_changed"],
}),
},
},
},
]);
This is a snippet that flags up.
SST version @ latest.thdxr
02/01/2022, 4:42 PMHubert
02/02/2022, 3:30 PMFrank
Hubert
02/15/2022, 12:21 PMFrank
props.topicA
and props.topicB
have the same id
^^ ie. id is the 2nd parameter passed into the constructor new sst.Topic(this, "topicId", {…});
Frank
Hubert
02/17/2022, 2:06 PMFrank
Frank
Frank
Hubert
02/21/2022, 10:34 AM