如何在 AWS SAM 或 Cloudformation 中添加身份提供商

How to add Identity Provider in AWS SAM or Cloudformation

我正在尝试在我的 SAM 应用程序中添加身份提供者,如 here 所述。

当我 运行 sam deploy 我得到以下错误:

The attribute mapping is missing required attributes [nickname] (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: xy; Proxy: null)  

尽管在我的 YAML 定义中,我将属性 nickname 映射如下:

UserPoolIdentityProvider:
    Type: AWS::Cognito::UserPoolIdentityProvider
    Properties: 
      AttributeMapping:
        given_name: "nickname"
        sub: "username"
        email: "email"
      ProviderDetails:
        ...

检查提供商是否具有“昵称”属性以及池是否支持该属性。