

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 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
```