I am sure this has been asked before. I’d like to ...
# sst
t
I am sure this has been asked before. I’d like to separate my stacks in multiple repos (for compliance / access control) but deploy to the same account / stage (for instance my sensitive credentials stack is separated in another repo but I need to deploy to stage prod with the same credentials. Is there any caveat / considerations ?
f
Hey @Timothée Clain, just make sure the app name + stack name pair are unique. For example, if two apps are both called
my-sst-app
in
sst.json
, and u have
MyStack
in both apps, one is going to overwrite the other.
Apart from that.. it should be fine
t
okay. and I guess I might need to ensure that shared resources (like VPC) are managed by one repo distinctly and retrieved by methods like:
Copy code
# Retrieve VPC information
vpc = ec2.Vpc.from_lookup(stack, "VPC",
    # This imports the default VPC but you can also
    # specify a 'vpcName' or 'tags'.
    is_default=True
)
?
f
Yeah, this should work for the default vpc
t
thx
f
but if u r creating a VPC in 1 app, and then try to
from_lookup
in another app, u have to make sure the former app is deployed first.
Otherwise the 2nd app would fail to build b/c it can’t find the VPC.
t
gotcha. I am wondering if it might not be easier to go full monorepo and leverage codeowners controls on github to limit access / write access to sensitive services. Because they still need to be integrated with the rest of infra. Example: an encrpytion lambda should be the only one with access to a kms key and any change should be scrutinized accordingly, but still needs to be accessed in the private VPC