Another question re: debugging locally. If I'm us...
# help
a
Another question re: debugging locally. If I'm using my personal stack
$(whomai)
, and I'm debugging something in
dev
environment, what's the best way to use
dev
cognito pool rather than my personal cognito pool?
t
When you say "debugging something in dev enviroment" can you tell me more about what that means
If using personal stacks, the expectation is all resources are isolated. If you need to share resources, you can use things like
UserPool.fromUserPoolId
to find an existing one
a
so the personal stack and dev stack are the same codebase, but I need to login using the dev userpool and point to dev database for example
without affecting the dev environment etc.
t
When you say "personal stack" do you mean a stage that's just for you?
a
yes
so something like this:
Copy code
defaultAuthorizer: new apigAuthorizers.HttpJwtAuthorizer ({
        // jwtIssuer: `<https://cognito-idp>.${scope.region}.<http://amazonaws.com/${userPool.userPoolId}|amazonaws.com/${userPool.userPoolId}>`,
        jwtIssuer: `<https://cognito-idp>.${scope.region}.<http://amazonaws.com/${cognito.UserPool.fromUserPoolId(this|amazonaws.com/${cognito.UserPool.fromUserPoolId(this>, 'USER_POOL_ID')}`,
        jwtAudience: [clientOne.userPoolClientId, clientTwo.userPoolClientId],
      }),
t
You can pass those variables in as environment variables and access in process.env
sst also loads
dotenv
a
thanks!