What should be the process when switching from run...
# sst
r
What should be the process when switching from running an API via
sst start
to running it just in the cloud? At the moment, if I do
sst deploy
Fire off some requests
sst start
Debug some requests Then I kill sst start Any future requests fail with the error
Copy code
Error: Debug client not connected.
Is the only way to do this to run another
sst deploy
?
p
Yes, AFAIK.
sst deploy
Deploy pushes the 'correct' handler to AWS, while
sst start
pushes the sst proxy to AWS that will redirect all calls to your local machine. If you don't call
sst deploy
after
sst start
you are just leaving the proxy running on AWS. Personally I have a rule never to run
sst start
in production, only in dev/staging and these are also separate AWS accounts (managed by https://github.com/99designs/aws-vault)
f
Hey @Ross Coundon, yeah @Pål Brattberg is right. You’d do a
sst deploy
to deploy the real handlers.
r
OK, thanks. I guessed that was the case as it worked, just wanted to be sure it was the right approach
f
To be honest, a few ppl complainted about this being cumbersome.
I’m thinking when you kill
sst start
, it automatically flips back and deploy the real lambdas.
Any thoughts? @Ross Coundon @Pål Brattberg
r
That would be good, kinda what I thought might happen but without knowing what's happening in the code it felt like it could be tricky to do reliably
s
I like the idea of it spinning down by default. I naturally tried
npx sst stop
to do this. I wonder if that would be a useful utility anyway, as their may be an eventual unhandled error e.g.
npx sst start
has been running for over 1 hour on an assumed iam permission that expired after 1 hour, so the default shutdown fails due to AWS permissions.
f
Good point on the expiration.
I’m thinking when on ctrl-c, SST asks u if u want to auto redeploy the real lambdas. And you also have the option to run
sst deploy
after to manually deploy it.
Hey guys, I implemented the solution that on ctrl-c,
sst start
re-runs
sst deploy
to deploy the real Lambdas, but the solution didn’t feel elegant after using it. It doesn’t provide much value over user hitting ctrl-c and runs
sst deploy
manually. I’m going to keep working on this on the side to find a better/faster way to flip between stub/real Lambda functions that doesn’t require a full
sst deploy
prcocess. For now, I added a warning msg in v0.19.0 that reminds ppl to run
sst deploy
to deploy the latest changes after they quit
sst start
.