

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. [AWS](https://github.com/awsdocs/aws-doc-sdk-examples) 

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS SDK 또는 CLI와 `DeleteCluster` 함께 사용
<a name="ecs_example_ecs_DeleteCluster_section"></a>

다음 코드 예시는 `DeleteCluster`의 사용 방법을 보여 줍니다.

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

**AWS CLI**  
**빈 클러스터를 삭제하는 방법**  
다음 `delete-cluster` 예시에서는 지정된 빈 클러스터를 삭제합니다.  

```
aws ecs delete-cluster --cluster MyCluster
```
출력:  

```
{
    "cluster": {
        "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/MyCluster",
        "status": "INACTIVE",
        "clusterName": "MyCluster",
        "registeredContainerInstancesCount": 0,
        "pendingTasksCount": 0,
        "runningTasksCount": 0,
        "activeServicesCount": 0
        "statistics": [],
        "tags": []
    }
}
```
자세한 내용은 *Amazon ECS 개발자 안내서*의 [클러스터 삭제](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/delete_cluster.html)를 참조하세요.  
+  API 세부 정보는 **AWS CLI 명령 참조의 [DeleteCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/delete-cluster.html)를 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이 cmdlet은 지정된 ECS 클러스터를 삭제합니다. 삭제하기 전에 이 클러스터에서 모든 컨테이너 인스턴스의 등록을 취소해야 합니다. **   

```
Remove-ECSCluster -Cluster "LAB-ECS"
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-ECSCluster (DeleteCluster)" on target "LAB-ECS".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [DeleteCluster](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이 cmdlet은 지정된 ECS 클러스터를 삭제합니다. 삭제하기 전에 이 클러스터에서 모든 컨테이너 인스턴스의 등록을 취소해야 합니다. **   

```
Remove-ECSCluster -Cluster "LAB-ECS"
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-ECSCluster (DeleteCluster)" on target "LAB-ECS".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteCluster](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------
#### [ Rust ]

**SDK for Rust**  
 GitHub에 더 많은 내용이 있습니다. [AWS 코드 예 리포지토리](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1/examples/ecs#code-examples)에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

```
async fn remove_cluster(
    client: &aws_sdk_ecs::Client,
    name: &str,
) -> Result<(), aws_sdk_ecs::Error> {
    let cluster_deleted = client.delete_cluster().cluster(name).send().await?;
    println!("cluster deleted: {:?}", cluster_deleted);

    Ok(())
}
```
+  API 세부 정보는 *AWS SDK for Rust API 참조*의 [DeleteCluster](https://docs.rs/aws-sdk-ecs/latest/aws_sdk_ecs/client/struct.Client.html#method.delete_cluster)를 참조하세요.

------