

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# EventSource
<a name="sam-property-function-eventsource"></a>

Objek yang menggambarkan sumber peristiwa yang memicu fungsi. Setiap peristiwa terdiri dari tipe dan satu set properti yang bergantung pada tipe itu. Untuk informasi lebih lanjut tentang properti dari setiap sumber peristiwa, lihat topik yang sesuai dengan tipe tersebut.

## Sintaksis
<a name="sam-property-function-eventsource-syntax"></a>

Untuk mendeklarasikan entitas ini dalam template AWS Serverless Application Model (AWS SAM) Anda, gunakan sintaks berikut.

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

```
  [Properties](#sam-function-eventsource-properties): {{AlexaSkill | Api | CloudWatchEvent | CloudWatchLogs | Cognito | DocumentDB | DynamoDB | EventBridgeRule | HttpApi | IoTRule | Kinesis | MQ | MSK | S3 | Schedule | ScheduleV2 | SelfManagedKafka | SNS | SQS}}
  [Type](#sam-function-eventsource-type): {{String}}
```

## Sifat-sifat
<a name="sam-property-function-eventsource-properties"></a>

 `Properties`   <a name="sam-function-eventsource-properties"></a>
Objek menggambarkan sifat pemetaan peristiwa ini. Set properti harus sesuai dengan tipe yang ditentukan.  
*Jenis* [[[[[[: [AlexaSkill](sam-property-function-alexaskill.md)\| [Api](sam-property-function-api.md) \| \| \| [Cognito [CloudWatchEvent[CloudWatchLogs](sam-property-function-cloudwatchlogs.md)](sam-property-function-cloudwatchevent.md)](sam-property-function-cognito.md)\| DocumentDB \| DynamoDB [\| \| \| [EventBridgeRule](sam-property-function-eventbridgerule.md)](sam-property-function-documentdb.md)Io \| [TRuleKinesis \| [MQ](sam-property-function-mq.md) \| MSK [\|](sam-property-function-dynamodb.md) S3 [HttpApi](sam-property-function-httpapi.md)\| Jadwal \| Schedulev2](sam-property-function-iotrule.md)[\| \|](sam-property-function-kinesis.md) SNS \| SQS [SelfManagedKafka](sam-property-function-selfmanagedkafka.md)](sam-property-function-sqs.md)](sam-property-function-sns.md)](sam-property-function-schedulev2.md)](sam-property-function-schedule.md)](sam-property-function-s3.md)](sam-property-function-msk.md)  
*Wajib*: Ya  
*CloudFormation kompatibilitas*: Properti ini unik AWS SAM dan tidak memiliki CloudFormation padanan.

 `Type`   <a name="sam-function-eventsource-type"></a>
Jenis peristiwa.  
*Nilai yang valid*: `AlexaSkill``Api`,`CloudWatchEvent`,`CloudWatchLogs`,`Cognito`,`DocumentDB`,`DynamoDB`,,`EventBridgeRule`,`HttpApi`,`IoTRule`,`Kinesis`,`MQ`,`MSK`,`S3`,`Schedule`,`ScheduleV2`,`SelfManagedKafka`,`SNS`, `SQS`  
*Tipe*: String  
*Wajib*: Ya  
*CloudFormation kompatibilitas*: Properti ini unik AWS SAM dan tidak memiliki CloudFormation padanan.

## Contoh
<a name="sam-property-function-eventsource--examples"></a>

### APIEvent
<a name="sam-property-function-eventsource--examples--apievent"></a>

Contoh menggunakan peristiwa API

#### YAML
<a name="sam-property-function-eventsource--examples--apievent--yaml"></a>

```
ApiEvent:
  Type: Api
  Properties:
    Method: get
    Path: /group/{user}
    RestApiId: 
      Ref: MyApi
```