

# 查看 Amazon ECS 服务修订详细信息
<a name="view-service-revision"></a>

您可以查看有关在 2024 年 10 月 25 日当天或之后创建的以下服务修订类型的信息：
+ 源：当前部署的工作负载配置
+ 目标：要部署的工作负载配置

------
#### [ Amazon ECS Console ]

1. 在 [https://console.aws.amazon.com/ecs/v2](https://console.amazonaws.cn/ecs/v2) 打开控制台。

1. 在 **Clusters**（集群）页面上，选择集群。

1. 在“集群详细信息”页面，找到**服务**部分，然后选择服务。

   此时将显示服务详细信息页面。

1. 在服务详细信息页面上，选择**部署**。

1. 选择要查看的服务修订。


<table>
<thead>
  <tr><th>查看此部署类型的服务修订</th><th>请执行该操作</th><th></th></tr>
</thead>
<tbody>
  <tr><td>正在进行的部署</td><td>在<b>正在进行的部署</b>下，执行以下操作：<ul><li> 要查看源服务修订，请在<b>服务修订</b>下，选择源<b>修订类型</b>的服务修订 ID。 </li><li> 要查看目标服务修订，请在<b>服务修订</b>下，选择目标<b>修订类型</b>的服务修订 ID。 </li></ul></td><td></td></tr>
  <tr><td>上一次部署</td><td>在<b>上一次部署</b>下，选择<b>目标服务修订</b>。</td><td></td></tr>
  <tr><td>已完成的部署</td><td>在<b>服务部署</b>下，执行以下操作：<ul><li> 在<b>目标服务修订</b>下，选择相应 ID。 </li></ul></td><td></td></tr>
</tbody>
</table>


------
#### [ Amazon CLI ]

1. 运行 `describe-service-deployments` 以检索服务修订 ARN。

   将变量替换为您自己的值。

   ```
   aws ecs describe-service-deployments --service-deployment-arns arn:aws:ecs:{{region}}{{:account-id}}:service/{{cluster-name}}/{{service-name}}/{{NCWGC2ZR-taawPAYrIaU5}}
   ```

   注意 `sourceServiceRevisions` 或 `targetServiceRevisions` 的 `arn`。

   ```
   {
       "serviceDeployments": [
           {
               "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5",
               "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
               "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
               "updatedAt": "2024-09-10T16:49:35.572000+00:00",
               "sourceServiceRevision": {
                   "arn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373578954",
                   "requestedTaskCount": 0,
                   "runningTaskCount": 0,
                   "pendingTaskCount": 0
               },
               "targetServiceRevision": {
                   "arn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
                   "requestedTaskCount": 0,
                   "runningTaskCount": 0,
                   "pendingTaskCount": 0
               },
               "status": "IN_PROGRESS",
               "deploymentConfiguration": {
                   "deploymentCircuitBreaker": {
                       "enable": false,
                       "rollback": false
                   },
                   "maximumPercent": 200,
                   "minimumHealthyPercent": 100
               }
           }
       ],
       "failures": []
   }
   ```

1. 运行 `describe-service-revisions`。使用从 `arn` 中返回的 `describe-service-deployments`。

   将变量替换为您自己的值。

   ```
   aws ecs describe-service-revisions --service-revision-arns arn:aws:ecs:{{region}}:{{123456789012}}:service-revision/{{cluster-name}}/{{service-name}}/{{4980306466373577095}}
   ```

------