

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# Amazon EventBridge での Amazon Redshift データ API のイベントのモニタリング
<a name="data-api-monitoring-events"></a>

お客様独自のアプリケーション、Software as a Service (SaaS) アプリケーション、AWSサービスからのリアルタイムデータのストリームを配信する EventBridge で、Data API イベントをモニタリングできます。EventBridge では、データは AWS Lambda や Amazon SNS などのターゲットにルーティングされます。これらのイベントは、CloudWatch Events に表示されるイベントと同じで、AWSリソースの変更を記述するシステムイベントのストリームをほぼリアルタイムで配信します。イベントは、Amazon Redshift データベースを含むアカウントに送信されます。例えば、別のアカウントでロールを引き受ける場合、イベントはそのアカウントに送信されます。詳細については、*Amazon EventBridge ユーザーガイド*の「[Amazon EventBridge events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)」を参照してください。

データ API イベントは、`ExecuteStatement`または `BatchExecuteStatement` API オペレーションが `WithEvent` オプションを `true` に設定するときに送信されます。`state` フィールドには次のいずれかの値が含まれます。
+ ABORTED – クエリの実行がユーザーによって停止されました。
+ FAILED – クエリの実行に失敗しました。
+ FINISHED – クエリの実行が終了しました。

イベントは保証に基づいて配信されます。詳細については、*Amazon EventBridge ユーザーガイド*の「[Events from AWS services](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html)」を参照してください。

## データ API 終了イベントの例
<a name="data-api-monitoring-events-finished"></a>

以下の例は、`ExecuteStatement`API オペレーションが終了したときの Data API のイベントを示しています。この例では、`test.testtable`という名前のステートメントの実行が終了しました。

```
{
    "version": "0",
    "id": "18e7079c-dd4b-dd64-caf9-e2a31640dab0",
    "detail-type": "Redshift Data Statement Status Change",
    "source": "aws.redshift-data",
    "account": "123456789012",
    "time": "2020-10-01T21:14:26Z",
    "region": "us-east-1",
    "resources": [
        "arn:aws:redshift:us-east-1:123456789012:cluster:redshift-cluster-1"
    ],
    "detail": {
        "principal": "arn:aws:iam::123456789012:user/myuser",
        "statementName": "test.testtable",
        "statementId": "dd2e1ec9-2ee3-49a0-819f-905fa7d75a4a",
        "redshiftQueryId": -1,
        "state": "FINISHED",
        "rows": 1,
        "expireAt": 1601673265
    }
}
```