If you deploy a UserPool via CloudFormation, e.g:
Resources:
UserPool:
Type: 'AWS::Cognito::UserPool'
Properties:
...
Schema:
- Name: email
AttributeDataType: String
Mutable: true
Required: true
and then update the attributes to make name
required:
Schema:
- Name: email
AttributeDataType: String
Mutable: true
Required: true
- Name: name
AttributeDataType: String
Mutable: true
Required: true
AWS thinks that name
is a custom attribute and fails with:
Required custom attributes are not supported currently. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: ...)
It's only an update that fails, deploying a clean stack correctly sets both the email
and name
standard attributes to required.
Is there any way for the update to succeed?
Unfortunately this is some sort of bug from CloudFormation. Very similar to other issues, for example on the update of DynamoDB tables with more than one index.
The only feasible way to do the update is to do that in two steps:
name
), deploy the CloudFormationRequire: true
in your case), deploy the CloudFormationAs previously said there are quite a lot of issues similar to that case, and you'd better signal your issue to AWS in order to get support and the bug fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With