Is there any way to rename a SNS topic without hav...
# help
k
Is there any way to rename a SNS topic without having to redeploy everything 😂
I accidentally added an SNS topic name that is not
stage
aware and now that is causing me headaches
d
since the name is part of the arn...nope
k
I was trying to create a new topic and point all stuff to that new topic and than delete the old one… but I am getting an error like this when I try to do that
Copy code
❌  kujtim-v1-devstride-EventsStack failed: Export kujtim-v1-devstride-EventsStack:ExportsOutputRefDevStrideSnsFiFoTopic321EDAD8F239367B cannot be deleted as it is in use by kujtim-v1-devstride-ItemStack
I had this on the
ItemStack
Copy code
eventStack.snsFiFo.addSubscribers(this, [
      {
        queue:
          fifoItemModuleEventsTarget instanceof sst.Queue
            ? fifoItemModuleEventsTarget
            : undefined,
        function:
          fifoItemModuleEventsTarget instanceof sst.Function
            ? fifoItemModuleEventsTarget
            : undefined,
        subscriberProps: {
          filterPolicy: {
            DetailType: SubscriptionFilter.stringFilter({
              allowlist: [FolderParentChangedFIFOIntegrationEvent.name],
            }),
          },
        },
      },
    ]);
And removed it… You would think after removing this the dependency would be removed also 🤷‍♂️
f
Hey @Kujtim Hoxha, in the stack you are creating the SNS topic, try adding a manual export of the old topic arn:
Copy code
this.exportValue(oldTopic.topicArn);
This will preserve the old export. You can remove this line after you move over the rest of the app to use the new topic.
Give it a try!
d
Just as a note, this unintuitive exports functionality and rigidity have caused me never to use them, and I find SSM parameters to be significantly easier and more flexible (and still free). Just letting you know you have options.
k
Yeah this is very weird behavior, @Frank thanks for the suggestion I think that is working 👍
f
Alright, starting v0.60.8, SST will handle this automatically by temporarily adding the exports.
k
This is great awesome job man