

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

# 步骤 2：执行与 SNS 关联的示例应用程序
<a name="execute-sample-application"></a>

1. 在 AWS Lambda 控制台的导航面板上，选择**应用程序**。

1. 在 **Applications (应用程序)** 页面上的搜索字段中，搜索 `serverlessrepo-fork-example-ecommerce-{{my-app}}`，然后选择该应用程序。

1. 在 **Resources (资源)** 部分中，执行以下操作：

   1. 例如，要查找类型为的资源 **ApiGatewayRestApi**，请按**类型**对资源进行排序`ServerlessRestApi`，然后展开该资源。

   1. 将显示两个嵌套资源，分别是 “**ApiGateway部署**” 和 “**ApiGateway阶段**”。

   1. 复制链接 **Prod API endpoint (Prod API 终端节点)** 并为其附加 `/checkout`，例如：

      ```
      https://abcdefghij.execute-api.us-east-2.amazonaws.com/Prod/checkout
      ```

1. 将以下 JSON 复制到名为 `test_event.json` 的文件中。

   ```
   {
      "id": 15311,
      "date": "2019-03-25T23:41:11-08:00",
      "status": "confirmed",
      "customer": {
         "id": 65144,		
   	 "quantity": 2,
         "price": 25.00,
         "subtotal": 50.00
      }]
   }
   ```

1. 要将 HTTPS 请求发送到您的 API 端点，请通过执行 `curl` 命令来将示例事件负载作为输入传递，例如：

   ```
   curl -d "$(cat test_event.json)" https://abcdefghij.execute-api.us-east-2.amazonaws.com/Prod/checkout
   ```

   API 将返回以下空响应，并指示已成功执行：

   ```
   { }
   ```