我创建了一个用户,例如:
SuperAdminUser:
Type: AWS::Cognito::UserPoolUser
Properties:
DesiredDeliveryMediums:
- EMAIL
Username: !Ref SuperAdminEmail
UserAttributes:
- Name: email
Value: !Ref SuperAdminEmail
UserPoolId:
Fn::ImportValue:
!Sub ${BaseStack}-Cognito
然后定义了用户池:
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
AdminCreateUserConfig:
AllowAdminCreateUserOnly: false
UnusedAccountValidityDays: 3
LambdaConfig:
PreSignUp: !GetAtt CognitoPreSignUpHook.Arn
Policies:
PasswordPolicy:
MinimumLength: 8
RequireNumbers: true
UsernameAttributes:
- email
我注意到它找不到用户,因为用户名看起来像:9f8aecc2-530d-411d-8d73-c3b775da1893
,而在这种情况下!Ref
给出了用户的电子邮件。我发现添加
UsernameAttributes:
- email
我该如何解决?我注意到用户资源不允许我获取用户的Sub ...