

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS Marketplace 契約 EventBridge イベント
<a name="agreement-eventbridge"></a>

AWS Marketplace は、契約のライフサイクル (購入したオファー) で特定のイベントが発生したときに Amazon EventBridge に通知を送信します。これらのイベントを使用してワークフローを自動化し、マーケットプレイスの購入を追跡できます。

次の表に、 が EventBridge AWS Marketplace に送信する購入者イベントを示します。


| [Event] (イベント) | 説明 | 
| --- | --- | 
| 購入契約の作成 - アクセプタ | アカウントで新しい購入契約を作成、更新、または置き換えたときに送信されます。 | 
| 購入契約の修正 - アクセプタ | 既存の購入契約に変更が加えられたときに送信されます | 
| 購入契約の終了 - アクセプタ | 購入契約がキャンセル、期限切れ、終了、更新、または置き換えられたときに送信されます | 
| 購入契約の終了 - アクセプタ | 購入契約の有効期限が切れる 30、60、および 90 日前に送信 | 

## 概要:
<a name="agreement-events-overview"></a>

購入者は、以下の購入契約のライフサイクルイベントに関する EventBridge 通知を受け取ります。
+ 契約の作成
+ 契約の修正
+ 契約の終了 (キャンセル、有効期限、終了)
+ 契約の終了

すべてのイベントは、イベントソース を使用して `us-east-1`リージョンのデフォルトの EventBridge イベントバスに送信されます`aws.agreement-marketplace`。

## イベントタイプ
<a name="agreement-event-types"></a>

### 購入契約の作成 - アクセプタ
<a name="agreement-created-event"></a>

AWS Marketplace は、アカウントに新しい購入契約が作成されると、このイベントを送信します。

**トリガーシナリオ:**
+ `NEW` - 契約が初めて作成される
+ `REPLACE` - 新しいプライベートオファーは、契約ベースのオファー (ABO) の一部として承諾する必要があります
+ `RENEW` - 契約は有効期限時に自動更新されます (有効になっている場合)

**イベントスキーマ:**

```
{
  "version": "0",
  "id": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
  "detail-type": "Purchase Agreement Created - Acceptor",
  "source": "aws.agreement-marketplace",
  "account": "<Buyer Account ID>",
  "time": "2024-08-30T21:36:03Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aws-marketplace::agreement:agmt-9xyz8wmklp67rt32nb1qv45ds"
  ],
  "detail": {
    "requestId": "7f3e2d1c-a9b8-4f5e-6d7c-1234567890ab",
    "catalog": "AWSMarketplace",
    "agreement": {
      "id": "agmt-9xyz8wmklp67rt32nb1qv45ds",
      "intent": "NEW|RENEW|REPLACE",
      "status": "ACTIVE",
      "acceptanceTime": "2024-06-26T21:36:03Z",
      "startTime": "2024-08-30T21:36:03Z",
      "endTime": "2025-05-30T21:36:03Z"
    },
    "acceptor": {
      "accountId": "<Buyer Account ID>"
    },
    "proposer": {
      "accountId": "<Proposer Account ID>"
    },
    "offer": {
      "id": "offer-abcdef123456"
    }
  }
}
```

### 購入契約の修正 - アクセプタ
<a name="agreement-amended-event"></a>

AWS Marketplace は、条件、料金、その他の契約パラメータの変更など、既存の購入契約に変更が加えられたときに、このイベントを送信します。

**イベントスキーマ:**

```
{
  "version": "0",
  "id": "12345678-1234-1234-1234-123456789012",
  "detail-type": "Purchase Agreement Amended Acceptor",
  "source": "aws.agreement-marketplace",
  "account": "<Buyer Account ID>",
  "time": "2024-08-30T21:36:03Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aws-marketplace::aws:agreement:agmt-4mwg1nevbokzw95eca5797ixs"
  ],
  "detail": {
    "requestId": "3d4c9f9b-b809-4f5e-9fac-a9ae98b05cbb",
    "catalog": "AWSMarketplace",
    "agreement": {
      "id": "agmt-4mwg1nevbokzw95eca5797ixs",
      "intent": "AMEND",
      "status": "ACTIVE",
      "acceptanceTime": "2024-06-26T21:36:03Z",
      "startTime": "2024-08-30T21:36:03Z",
      "endTime": "2025-05-30T21:36:03Z"
    },
    "acceptor": {
      "accountId": "<Buyer Account ID>"
    },
    "proposer": {
      "accountId": "<Proposer Account ID>"
    },
    "offer": {
      "id": "offer-1234567890123"
    }
  }
}
```

### 購入契約の終了 - アクセプタ
<a name="agreement-ended-event"></a>

AWS Marketplace 購入契約が終了すると、 はこのイベントを送信します。

**トリガーシナリオ:**
+ `CANCELLED` - 定義された終了日より前に契約を終了した
+ `EXPIRED` - 契約が定義された終了日に達した
+ `TERMINATED` - 契約を AWS 終了した (支払いの失敗など)
+ `RENEWED` - 契約が新しい契約に更新されました
+ `REPLACED` - 契約は契約代替オファーを使用して置き換えられました

**イベントスキーマ:**

```
{
  "version": "0",
  "id": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
  "detail-type": "Purchase Agreement Ended - Acceptor",
  "source": "aws.agreement-marketplace",
  "account": "987654321098",
  "time": "2024-08-30T21:36:03Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aws-marketplace:aws:agreement:agmt-9xyz8wmklp67rt32nb1qv45ds"
  ],
  "detail": {
    "requestId": "7f3e2d1c-a9b8-4f5e-6d7c-1234567890ab",
    "catalog": "AWSMarketplace",
    "agreement": {
      "id": "agmt-9xyz8wmklp67rt32nb1qv45ds",
      "status": "CANCELLED|EXPIRED|RENEWED|REPLACED|TERMINATED"
    },
    "acceptor": {
      "accountId": "<Buyer Account ID>"
    },
    "proposer": {
      "accountId": "<Proposer Account ID>"
    },
    "offer": {
      "id": "offer-abcdef123456"
    }
  }
}
```

### 購入契約の終了 - アクセプタ
<a name="agreement-ending-event"></a>

AWS Marketplace は、購入契約の有効期限が切れる 30、60、および 90 日前にこのイベントを送信します。

このイベントには、他の購入者イベントには存在しない追加のフィールドが含まれます。
+ `agreement.autoRenewalEnabled` - 契約で自動更新が有効になっているかどうかを示します
+ `product.id` および `product.title` - 契約の製品情報
+ `proposer.name` および `offer.name` - 販売者とオファーの人間が読める名前

**イベントスキーマ:**

```
{
  "version": "0",
  "id": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
  "detail-type": "Purchase Agreement Ending - Acceptor",
  "source": "aws.agreement-marketplace",
  "account": "<Buyer Account ID>",
  "time": "2025-03-31T21:36:03Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aws-marketplace::aws:agreement:agmt-9xyz8wmklp67rt32nb1qv45ds"
  ],
  "detail": {
    "requestId": "7f3e2d1c-a9b8-4f5e-6d7c-1234567890ab",
    "catalog": "AWSMarketplace",
    "agreement": {
      "id": "agmt-9xyz8wmklp67rt32nb1qv45ds",
      "startTime": "2024-08-30T21:36:03Z",
      "endTime": "2025-05-30T21:36:03Z",
      "autoRenewalEnabled": true,
      "status": "ACTIVE"
    },
    "product": {
      "id": "prod-abc123xyz456",
      "title": "Example Product Title"
    },
    "acceptor": {
      "accountId": "<Buyer Account ID>"
    },
    "proposer": {
      "name": "Example Seller Name",
      "accountId": "<Proposer Account ID>"
    },
    "offer": {
      "id": "offer-abcdef123456",
      "name": "Example Offer Name"
    }
  }
}
```

## 一般的なイベントフィールド
<a name="agreement-common-fields"></a>

すべての購入者イベントには、次の共通フィールドが含まれます。


| フィールド | 説明 | 
| --- | --- | 
| requestId | 重複イベントの重複排除に使用される UUID | 
| catalog |  AWS Marketplace カタログ (通常はAWSMarketplace」) | 
| agreementId | 契約の一意の識別子 | 
| acceptor.accountId |  AWS アカウント ID | 
| proposer.accountId | 販売者の AWS アカウント ID | 
| offer.id | オファー識別子 | 

## EventBridge ルールの設定
<a name="agreement-eventbridge-setup"></a>

これらの通知を受信するには、購入者イベントのイベントパターンに一致する EventBridge ルールを作成します。ルールの作成の詳細については、[「Amazon EventBridge ユーザーガイド」の「Amazon EventBridge ルールの作成](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule.html)」を参照してください。 * EventBridge *