https://serverless-stack.com/ logo
#sst
Title
# sst
d

Daniel Ashcraft

05/18/2022, 4:09 PM
Looking for some advice, ran into an interesting issue where sst spun up duplicate instances of open-search database on every dry dev run and i'm looking to prevent that in the future. This is using
aws-cdk-lib/aws-opensearchservice
and sst v1.1
t

thdxr

05/18/2022, 4:09 PM
hey what do you mean every dry dev run?
do you mean after tearing down a stage and bringing it back up you had leftovers from the old stage?
d

Daniel Ashcraft

05/18/2022, 4:09 PM
every time i ran `sst start`it created duplicate db's
t

thdxr

05/18/2022, 4:10 PM
without running a remove in between?
d

Daniel Ashcraft

05/18/2022, 4:10 PM
Correct
t

thdxr

05/18/2022, 4:10 PM
can you show me your cdk code?
this should be impossible unless you're dynamically defining an ID somewhere
d

Daniel Ashcraft

05/18/2022, 4:11 PM
Copy code
const searchDomain = new opensearch.Domain(stack, 'ElasticUploadQueryDB', {
    version: opensearch.EngineVersion.OPENSEARCH_1_0,
    enableVersionUpgrade: true,
    useUnsignedBasicAuth: true,
    enforceHttps: true,
    ...elasticSearchConfig
  })
t

thdxr

05/18/2022, 4:11 PM
ok that looks fine and can you show me the stack and how you're adding it to the app?
d

Daniel Ashcraft

05/18/2022, 4:11 PM
Copy code
stack.searchDomain = searchDomain
After that we interface with it via the url and basic auth, so there's no additional config really
t

thdxr

05/18/2022, 4:12 PM
I'm probably going to have to see your whole stack code
d

Daniel Ashcraft

05/18/2022, 4:12 PM
It's open source
one sec
Actually, that hasn't been released to the pub yet
I can pair/zoom if that works
t

thdxr

05/18/2022, 4:14 PM
can you DM me the stack?
I can zoom later otherwise
d

Daniel Ashcraft

05/18/2022, 4:15 PM
Verifying now
@Jesse Harlin
j

Jesse Harlin

05/18/2022, 7:17 PM
Hey, I want to add (I am working on the same project with @Daniel Ashcraft) It was doing this for s3 buckets as well
it didn't do this in the past, and I believe it started after updating past 0.9x to version 1.x.x
t

thdxr

05/18/2022, 7:25 PM
this is the default behavior of CDK, for stateful things it does not remove them automatically
j

Jesse Harlin

05/18/2022, 7:36 PM
I am aware, that if I remove as in 'sst remove' then it will leave dynamo db's and s3 buckets. What I don't expect is without running remove, for it to make several duplicates
so this was when I was running
sst start
in fact the times I did run
sst remove
I think the CLI would report what wasn't removed and I could go clean those out, which was useful. These copies were unexpected copies