-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Cognito Schema #1747
Comments
Here is a temporary workaround for anybody looking to solve the problem now: import { App, Stack, StackProps, Token } from '@aws-cdk/cdk'
import { CfnUserPool, CfnUserPoolClient } from '@aws-cdk/aws-cognito'
export class CognitoStack extends Stack {
constructor(scope: App, id: string, props?: StackProps) {
super(scope, id, props)
/**
* Use CfnUserPool until support is added for Schema attribute
* https://github.com/awslabs/aws-cdk/issues/1747
*/
const userPool = new CfnUserPool(this, 'Resource', {
userPoolName: 'helloamplify',
usernameAttributes: [new Token('email')],
autoVerifiedAttributes: [new Token('email')],
schema: [
{
attributeDataType: 'String',
name: 'phone_number',
mutable: true,
required: true
},
{
attributeDataType: 'String',
name: 'email',
mutable: false,
required: true
}
]
})
// tslint:disable:no-unused-expression
new CfnUserPoolClient(this, 'helloamplify', {
userPoolId: userPool.userPoolId,
clientName: 'hello-amplify-client'
})
}
} |
Token constructor is private in version 0.39. Import needs to be corrected. |
Would this be a correct configuration ?
|
We also have hit this limitation and would like to be able to add schema as well. We went for overrides for now instead of the suggested work around above. |
I have a proposal to implement CDK APIs for Congito - aws/aws-cdk-rfcs#91 - that addresses this issue. The RFC is in the comments period. If you'd like to see how the API is going to look and propose changes, this is your chance. |
Just wanted to link to the higher level 'tracking issue' for this PR for easier cross-reference: |
) BREAKING CHANGE: `UserPoolAttribute` has been removed. It is no longer required to defined a `UserPool`. closes #1747
Add CDK support so that Schema information can be configured for UserPools. This allows one to specify additional attributes that are allowed/required for new users.
The text was updated successfully, but these errors were encountered: