I have split the storage and auth stacks (that han...
# help
f
I have split the storage and auth stacks (that handle s3, cognito and dynamodb) out of my SST application into a separate repository and have everything working correctly with regards to my app importing the exported values out of the storage and auth stacks as they reside in the same AWS account. I have also created multiple AWS accounts using AWS Organizations so I can separate dev from prod.  At some point I'd like create a sandbox AWS account (still inside the AWS Organization) for local development of the app, but I would like to be able to reference the storage and auth stacks in the main dev account. I am relatively new to AWS and was hoping someone could point me in the right direction in terms of how my SST app stacks in the sandbox account can use the s3/cognito/dynamodb infrastructure in the dev account. Can anyone point me at any articles, sample code, or even suggest what terms to google in order to learn how to accomplish this?
j
You can create an IAM role that grants access to AWS resources in your dev account to your Sandbox account. I would avoid doing this personally. If you want to develop your application in a different account, you should use a CDK pipeline with multi-account deployment. This would replicate your stacks in a dev account and sandbox account. If you want dev data in your sandbox stage, you could look at sending cross-account events via eventbridge, but I would not recommend direct resource access. I realise this is all opinionated though, and your use case may make sense to use IAM roles instead.