

支援終止通知：2026 年 5 月 20 日， AWS 將終止對 的支援 AWS IoT Events。2026 年 5 月 20 日之後，您將無法再存取 AWS IoT Events 主控台或 AWS IoT Events 資源。如需詳細資訊，請參閱[AWS IoT Events 終止支援](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-end-of-support.html)。

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

# 範例：設定 的記錄選項 AWS IoT Events
<a name="logging-options"></a>

適當的記錄對於監控、偵錯和稽核您的 AWS IoT Events 應用程式至關重要。本節提供 中可用記錄選項的概觀 AWS IoT Events。

此範例示範如何設定允許 AWS IoT Events 將資料記錄到 CloudWatch Logs 的 IAM 角色。在資源 ARN 中使用萬用字元 (`*`) 可讓您跨 AWS IoT Events 基礎設施進行全面記錄。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": [
                    "iotevents.amazonaws.com"
                ]
            },
            "Action": "sts:AssumeRole",
            "Condition": {
                "StringEquals": {
                "aws:SourceAccount": "{{123456789012}}"
                },
                "ArnEquals": {
                "aws:SourceArn": "arn:aws:iotevents:{{us-east-1}}:{{123456789012}}:*"
                }
            }
        }
    ]
}
```

------