Patrick Young
08/15/2021, 2:22 AMconst userPoolId = cdk.Fn.importValue(`${props.infraCoreStage}-userpool-id`);
const userPool = cognito.UserPool.fromUserPoolId(this, CONSTANTS.environmentUserPool, userPoolId);
I can't seem to use the sst.Auth as userPool is a IUserPool.
this.auth = new sst.Auth(this, scope.logicalPrefixedName(CONSTANTS.authPrefixName), {
cognito: {
userPool, // does not like this
userPoolClient // or this
},
identityPool: {
allowUnauthenticatedIdentities: false
},
google: {
clientId
}
});
1. Is this not a common pattern?
2. What horrible thing I'm I doing wrong?
3. I miss water cooler days too...Sam Hulick
08/15/2021, 2:51 AMcognito
property & try:
cognitoUserPool: cognito.UserPool.fromUserPoolId(...)
Patrick Young
08/15/2021, 2:54 AMError: The "cognitoUserPool" property is deprecated. Use the "cognito.userPool" instead. More details on upgrading - <https://docs.serverless-stack.com/constructs/Auth#upgrading-to-v0120>
Sam Hulick
08/15/2021, 2:56 AMnew sst.Auth
as that would create a new pool.Sam Hulick
08/15/2021, 2:57 AMPatrick Young
08/15/2021, 3:00 AM} else if (cdk.Construct.isConstruct(cognitoProps.userPool)) {
isUserPoolImported = true;
this.cognitoUserPool = cognitoProps.userPool;
but yes I want to have just one user pool in the core stack or main account and multiple aws accounts use it as a reference.Patrick Young
08/15/2021, 3:01 AMFrank
Frank
new CoreStack(app, "core", {
stackName: /* if is a dev stage */
? `${app.name}-core`
: undefined,
})
You pretty much don’t parameterize the Core stack’s name with the stage name. Hence all the dev stages will deploy and share the same core stack.Frank