Is it possibile to make a condition on which clien...
# sst
g
Is it possibile to make a condition on which client redirect to local environment or which redirect to remote environment? When development is made by two developers the local live development could be messy. Could be nice to find some solution to isolate the redirection.
a
every dev should have their own stage.
b
On my side I rename the stack in
sst.json
- slight pain but it works.
a
no need to do that, just pass the --stage option, this ensures you are not limited to a stage per branch.
g
I found information on: https://docs.serverless-stack.com/live-lambda-development#using-within-a-team I’m evaluating which approach to use between: • Different Stage: I like this way to be quick although I don’t like to have many stack related to different stage on same aws account (I use AWS organization for dev account and prod account) • Different Stage on different account: It is nice to have a dedicated account but as guide say it is cumbersome to manage. Anyone would share his experience with the second approach?
a
I recently cam across something called AWS Organisations - https://aws.amazon.com/organizations/ Maybe this could help for the second approach. I prefer the first approach.
t
I use an AWS account per dev
It is a much bigger thing to setup but I use AWS sso to manage auth and then create an AWS account per dev that they have access to. Clean way to isolate things and track billing and stuff
g
Yes it is nice to mange different account, you can also create an organization unit to organize account of same project, but I think it is too much to handle also every single developer, every account generate a own bill.
@thdxr every developer own an aws account in your organization, but if some developer work on more projects, these project will be hosted in same account?
t
Yeah it's their scratch environment where they can do anything, all rolled up into the AWS org
I use terraform to setup all the org stuff so it's easy
f
@gio are the two developers working on different stacks in the same app? And you want some stacks to redirect to 1 dev’s machine, and the rest stacks to redirect to the other dev’s machine?
g
There are two developers on same stack, my initial idea was to keep only two stages (dev and prod), when starting locally sst (on dev stage) every users still continue to use remote lambdas except for the user which run sst and on demand other users that want be redirected on local instance (i didn’t spend time to understand how make this mechanism, maybe based on cognito sub?). Anyway it seems complex and could cause many problems on dev environment.
f
Ah I see. Yeah it’d make sense everyone have their own stage in this case.