

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 關閉容器洞見
<a name="cloudwatch-container-insights-disable"></a>

若要在運算環境中明確停用 Container Insights，請將 值設定為 `DISABLED`。

------
#### [ AWS 管理主控台 ]

1. 開啟 [AWS Batch 主控台](https://console.aws.amazon.com/batch/home)。

1. 選擇 **Environments (環境)**。

1. 選擇您想要的運算環境。

1. 在**容器洞見**索引標籤上，針對運算環境選擇**已停用**。

------
#### [ AWS CLI ]

使用 `update-compute-environment` 在現有的運算環境中停用 Container Insights。

```
$ aws batch update-compute-environment \
    --compute-environment {{my-compute-env}} \
    --ecs-settings containerInsights=DISABLED
```

------
#### [ API ]

在 [UpdateComputeEnvironment](https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateComputeEnvironment.html) 請求`DISABLED`中`containerInsights`將 設定為 。

```
{
    "computeEnvironment": "{{my-compute-env}}",
    "ecsSettings": {
        "containerInsights": "DISABLED"
    }
}
```

如需詳細資訊，請參閱《 *AWS Batch API 參考*》中的 [UpdateComputeEnvironment](https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateComputeEnvironment.html)。

------

**重要**  
在運算環境中設定 Container Insights 值後，您無法還原為預設 （取消設定） 行為，其中 Container Insights 設定是在 外部管理 AWS Batch。若要變更 Container Insights 模式，您必須`UpdateComputeEnvironment`使用新值呼叫 。  
這也表示如果您在 CloudFormation 範本中設定此屬性，堆疊復原就無法將設定還原為先前的取消設定狀態。