

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

# Amazon ECS 叢集資料包 (aws\$1opsworks\$1ecs\$1cluster)
<a name="data-bag-json-ecs-cluster"></a>

**重要**  
 AWS OpsWorks Stacks 此服務已於 2024 年 5 月 26 日終止，並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問，請透過 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 AWS 支援 團隊。

代表 Amazon ECS 叢集的設定。

下列範例示範如何使用 Chef 搜尋來搜尋單一資料包項目，然後搜尋多個資料包項目，以使用 Amazon ECS 叢集的名稱和 Amazon Resource Name (ARNs) 將訊息寫入 Chef 日誌：

```
ecs_cluster = search("aws_opsworks_ecs_cluster").first
Chef::Log.info("********** The ECS cluster's name is '#{ecs_cluster['ecs_cluster_name']}' **********")
Chef::Log.info("********** The ECS cluster's ARN is '#{ecs_cluster['ecs_cluster_arn']}' **********")

search("aws_opsworks_ecs_cluster").each do |ecs_cluster|
  Chef::Log.info("********** The ECS cluster's name is '#{ecs_cluster['ecs_cluster_name']}' **********")
  Chef::Log.info("********** The ECS cluster's ARN is '#{ecs_cluster['ecs_cluster_arn']}' **********")
end
```


****  

|  |  | 
| --- |--- |
| [ecs\$1cluster\$1arn](#data-bag-json-ecs-cluster-ecs-cluster-arn) | [ecs\$1cluster\$1name](#data-bag-json-ecs-cluster-ecs-cluster-name) | 

**ecs\$1cluster\$1arn**  <a name="data-bag-json-ecs-cluster-ecs-cluster-arn"></a>
叢集的 Amazon Resource Name (ARN) (字串)。

**ecs\$1cluster\$1name**  <a name="data-bag-json-ecs-cluster-ecs-cluster-name"></a>
叢集的名稱 (字串)。