从 serverless.yml 创建 AWS Cognito 用户池

akr*_*ntz 5 amazon-web-services amazon-cognito serverless-framework

我正在尝试使用 AWS Cognito 用户池进行用户身份验证,但我似乎无法弄清楚如何从serverless.yml文件中创建一个。我知道要创建其他资源,您可以执行以下操作:

resources:
  Resources:
    Table:
      Type: "AWS::DynamoDB::Table"  # Change this to "AWS::Cognito::UserPool"?
      DeletionPolicy: Retain
      Properties:                   # Change the properties here, but to what?
        AttributeDefinitions:
          -
            AttributeName: id
            AttributeType: S
        KeySchema:
          -
            AttributeName: id
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TableName: arn:aws:dynamodb:us-west-1:*:table/tablename
Run Code Online (Sandbox Code Playgroud)

我假设我只需要将类型"AWS:Cognito::UserPool"更改为并更改属性。但是,我不知道要将其更改为什么。

akr*_*ntz 2

对于那些寻找基本示例的人,请参阅@ionut 的答案。所有的配置都可以在这里AWS::Cognito::UserPool找到。至于,可以在这里找到。AWS::Cognito::UserPoolClient