Garret Harp
08/08/2021, 4:33 PMconst Cognito = new Auth(this, 'AuthResourceId', {
cognito: true
})
// Enable SES for emails:
const cfnUserPool = Cognito.cognitoUserPool!.node.defaultChild as CfnUserPool
cfnUserPool.emailConfiguration = {
emailSendingAccount: 'DEVELOPER',
replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
from: '<mailto:email@example.com|email@example.com>',
sourceArn: 'arn:something'
}
// Create domain for UserPool:
new CfnUserPoolDomain(this, 'DomainResourceId', {
userPoolId: Cognito.cognitoUserPool!.userPoolId,
domain: 'some-domain'
})
// Add a group:
new CfnUserPoolGroup(this, 'GroupResourceId', {
userPoolId: Cognito.cognitoUserPool!.userPoolId,
groupName: 'GroupName',
precedence: 0
})
Would be really nice if I could just do something similar to this:
const Cognito = new Auth(this, 'AuthResourceId', {
cognito: {
userPool: {
domain: 'some-domain',
groups: [{ id: 'ResourceId', groupName: 'GroupName', precedence: 0 }],
emailConfiguration: {
emailSendingAccount: 'DEVELOPER',
replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
...
}
}
}
})
Frank
Frank
Garret Harp
08/09/2021, 12:09 AM