

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# EventBridge 与一起使用 AWS 定价计算器
<a name="pc-event-bridge"></a>

每当您的账单估算中发生某些事件 EventBridge 时，控制台内 AWS 定价计算器 即可向 Amazon 发送事件。与其他目的地不同，您无需选择要提供的活动类型。 EventBridge 设置完成后，可以将定价计算器事件发送至 EventBridge。您可以使用 EventBridge 规则将事件路由到其他目标。有关设置的更多信息 EventBridge，请参阅《[亚马逊 * EventBridge API 参考》中的亚马逊 EventBridge *设置和先决条件](https://docs.aws.amazon.com//eventbridge/latest/userguide/eb-setup.html)。

以下列出了 AWS 定价计算器 发送到的事件 EventBridge。


****  

| 事件类型 | 说明 | 
| --- | --- | 
| BillEstimate 已创建 | 已创建账单估算。<br />事件中 EventBridge 将发出事件发送到的账单估价的 ARN、估算名称和估算 ID。 | 
| BillEstimate 成功了 | 已完成账单估算。这意味着现在您能够查看账单估算结果。<br />事件中 EventBridge 将发出事件发送到的账单估价的 ARN、估算名称和估算 ID。 | 
| BillEstimate 失败了 | 账单估算生成失败。<br />事件中 EventBridge 将发出事件发送到的账单估价的 ARN、估算名称和估算 ID。 | 

您还可以使用发送事件通知 AWS 定价计算器 来编写规则， EventBridge 以便在发生与您的估计值有关的事件时采取行动。例如，可获得向您发送的电子邮件通知。有关亚马逊规则的更多信息 EventBridge，请参阅《亚马逊 * EventBridge API 参考》 EventBridge中的 “在亚马逊*[创建规则](https://docs.aws.amazon.com//eventbridge/latest/userguide/eb-get-started.html#eb-gs-create-rule)”。

有关您可以使用 API 与之交互的操作和数据类型的更多信息，请参阅[亚马逊 EventBridge EventBridge API 参考](https://docs.aws.amazon.com//eventbridge/latest/APIReference/Welcome.html)中的*亚马逊 EventBridge API 参考*。

## 亚马逊 EventBridge 权限
<a name="pc-event-bridge-permissions"></a>

AWS 定价计算器 不需要任何其他权限即可向 Amazon 发送活动 EventBridge。

## 事件消息结构示例
<a name="pc-event-bridge-examples"></a>

**BillEstimate Created**

```
{
    "version": "0",
    "id": "00000000-0000-0000-0000-000000000001",
    "detail-type": "BillEstimate Created",
    "source": "aws.bcm-pricing-calculator",
    "account": "111122223333",
    "time": "2024-09-12T13:47:34Z",
    "region": "us-east-1",
    "resources": ["arn:aws:bcm-pricing-calculator::111122223333:bill-estimate/00000000-0000-0000-0000-000000000000"],
    "detail": {
        "id": "00000000-0000-0000-0000-000000000001",
        "name": "amzn-example-name"
     }
}
```

**BillEstimate 已成功**

```
{
    "version": "0",
    "id": "00000000-0000-0000-0000-000000000002",
    "detail-type": "BillEstimate Succeeded",
    "source": "aws.bcm-pricing-calculator",
    "account": "111122223333",
    "time": "2024-09-12T13:47:34Z",
    "region": "us-east-1",
    "resources": ["arn:aws:bcm-pricing-calculator::111122223333:bill-estimate/00000000-0000-0000-0000-000000000002"],
    "detail": {
        "id": "00000000-0000-0000-0000-000000000002",
        "name": "amzn-example-name"
     }
}
```

**BillEstimate 已失败**

```
{
    "version": "0",
    "id": "00000000-0000-0000-0000-000000000003",
    "detail-type": "BillEstimate Failed",
    "source": "aws.bcm-pricing-calculator",
    "account": "111122223333",
    "time": "2024-09-12T13:47:34Z",
    "region": "us-east-1",
    "resources": ["arn:aws:bcm-pricing-calculator::111122223333:bill-estimate/00000000-0000-0000-0000-000000000003"],
    "detail": {
        "id": "00000000-0000-0000-0000-000000000003",
        "name": "amzn-example-name",
        "failureReason": "We can't process this request right now because of an internal error. Try again later."
     }
}
```