

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Cognito
<a name="sam-property-function-cognito"></a>

描述 `Cognito` 事件源类型的对象。

## 语法
<a name="sam-property-function-cognito-syntax"></a>

要在 AWS Serverless Application Model (AWS SAM) 模板中声明此实体，请使用以下语法。

### YAML
<a name="sam-property-function-cognito-syntax.yaml"></a>

```
  [Trigger](#sam-function-cognito-trigger): List
  [UserPool](#sam-function-cognito-userpool): String
```

## Properties
<a name="sam-property-function-cognito-properties"></a>

 `Trigger`   <a name="sam-function-cognito-trigger"></a>
新用户群体的 Lambda 触发器配置信息。  
*类型*：列表  
*是否必需*：是  
*CloudFormation 兼容性*：此属性直接传递给`AWS::Cognito::UserPool`资源的`[LambdaConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-lambdaconfig.html)`属性。

 `UserPool`   <a name="sam-function-cognito-userpool"></a>
对在同一模板中 UserPool 定义的引用  
*类型*：字符串  
*是否必需*：是  
*CloudFormation 兼容性*：此属性是独有的 AWS SAM ，没有 CloudFormation 等效属性。

## 示例
<a name="sam-property-function-cognito--examples"></a>

### Cognito 事件
<a name="sam-property-function-cognito--examples--cognito-event"></a>

Cognito 事件示例

#### YAML
<a name="sam-property-function-cognito--examples--cognito-event--yaml"></a>

```
CognitoUserPoolPreSignup:
  Type: Cognito
  Properties:
    UserPool:
      Ref: MyCognitoUserPool
    Trigger: PreSignUp
```