Okay, I have two questions about sst start : Is th...
# help
l
Okay, I have two questions about sst start : Is the stack created based on me ? what if another dev starts the project for local dev while I am already developing from local ?
c
this is something I also have to better understand, and similar questions have been posted recently too. I personally believe that having a commit-eable
sst.json
is not a good idea and maybe we should move to a more flexible approach based on environment variables (like .env)
@thdxr mentioned above that they use an different AWS account for each developer but I am pretty sure that this is not what everybody is doing… for example, we usually prefix our CDK stacks with our github username when developing locally – but it’s always the same “dev” AWS account
(also because if you have even just a few services, it could not be super simple to provision each ‘personal’ developer’s AWS account)
t
If you're not using an aws account per dev I'd recommend using a different stage per dev. You can remove stage from
sst.json
and set it via an environment variable in the cdk entrypoint
c
good to know! It’s not clear (to me) how “deep” are the sst.json vars integrated in sst
t
Actually even simpler is just doing
sst start --stage $STAGE
and just making sure devs have that set locally
l
well
having different stage is not an option
t
how come?
l
we derive a lot of datas from ssm prefixed with the stage
so the stage determines the env variables of our lambdas
so the develop stage points to all our develop resources
aws and other
t
Is there a reason that has to be derived from
stage
and not another environment variable?
l
actually no, not really, we could use some env var and keep stage for other means
so that is a good point
I'll try that once I can start the project (stuck with wrong typechecking - cf my next comment)
f
We need to a better job documenting this. So debug stack is created with the stack name
$stageName-$appName-debug-stack
So if two ppl are both running
sst start
for the same app with the same stage and deploying to the same AWS account, it’s going to conflict.
By conflict i mean whoever connects the last will receive the request.
And the person who connected first will get disconnected with a message saying another client is connected.
does that make sense?
l
I see, yes, thx for the explaination