Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// ========================================================================
// Resource: Amazon Cognito User Pool
// ========================================================================
// Purpose: creates a user directory and allows federation from external IdPs
// See also:
// - https://aws.amazon.com/cognito/
// - https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cognito.CfnIdentityPool.html
// high level construct
const userPool: UserPool = new cognito.UserPool(this, id + "Pool", {
signInType: SignInType.EMAIL,
autoVerifiedAttributes: [UserPoolAttribute.EMAIL],
lambdaTriggers: {preTokenGeneration: preTokenGeneration}
});
// any properties that are not part of the high level construct can be added using this method
const userPoolCfn = userPool.node.defaultChild as CfnUserPool;
userPoolCfn.schema = [{
name: groupsAttributeName,
attributeDataType: "String",
mutable: true,
required: false,
stringAttributeConstraints: {
maxLength: "2000"
}
}];
// ========================================================================
// Resource: Amazon Cognito User Pool
// ========================================================================
// Purpose: creates a user directory and allows federation from external IdPs
// See also:
// - https://aws.amazon.com/cognito/
// - https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cognito.CfnIdentityPool.html
// high level construct
const userPool: UserPool = new cognito.UserPool(this, id + "Pool", {
signInType: SignInType.EMAIL,
autoVerifiedAttributes: [UserPoolAttribute.EMAIL],
lambdaTriggers: {preTokenGeneration: preTokenGeneration}
});
// any properties that are not part of the high level construct can be added using this method
const userPoolCfn = userPool.node.defaultChild as CfnUserPool;
userPoolCfn.schema = [{
name: groupsAttributeName,
attributeDataType: "String",
mutable: true,
required: false,
stringAttributeConstraints: {
maxLength: "2000"
}
}];
// create two groups, one for admins one for users