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

gio

07/01/2021, 8:31 AM
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

Ashishkumar Pandey

07/01/2021, 8:35 AM
every dev should have their own stage.
b

Brinsley

07/01/2021, 11:36 AM
On my side I rename the stack in
sst.json
- slight pain but it works.
a

Ashishkumar Pandey

07/01/2021, 11:37 AM
no need to do that, just pass the --stage option, this ensures you are not limited to a stage per branch.
g

gio

07/01/2021, 1:26 PM
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

Ashishkumar Pandey

07/01/2021, 1:28 PM
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

thdxr

07/01/2021, 1:39 PM
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

gio

07/01/2021, 1:42 PM
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

thdxr

07/01/2021, 2:15 PM
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

Frank

07/01/2021, 5:30 PM
@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

gio

07/02/2021, 9:47 AM
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

Frank

07/02/2021, 5:52 PM
Ah I see. Yeah it’d make sense everyone have their own stage in this case.