

# EC2 Fleet, 해당 인스턴스 및 해당 이벤트 설명
<a name="describe-ec2-fleet"></a>

EC2 Fleet 구성, EC2 Fleet의 인스턴스 및 EC2 Fleet의 이벤트 기록을 설명할 수 있습니다.

**Topics**
+ [

## EC2 Fleet 설명
](#describe-all-ec2-fleets)
+ [

## EC2 Fleet의 모든 인스턴스 설명
](#describe-instances-in-ec2-fleet)
+ [

## EC2 Fleet의 이벤트 기록 설명
](#describe-ec2-fleet-event-history)

## EC2 Fleet 설명
<a name="describe-all-ec2-fleets"></a>

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

**EC2 플릿을 설명하려면**  
[describe-fleets](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-fleets.html) 명령을 사용합니다.

```
aws ec2 describe-fleets \
    --fleet-ids fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
```

다음은 예제 출력입니다.

```
{
    "Fleets": [
        {
            "ActivityStatus": "fulfilled",
            "CreateTime": "2022-02-09T03:35:52+00:00",
            "FleetId": "fleet-364457cd-3a7a-4ed9-83d0-7b63e51bb1b7",
            "FleetState": "active",
            "ExcessCapacityTerminationPolicy": "termination",
            "FulfilledCapacity": 2.0,
            "FulfilledOnDemandCapacity": 0.0,
            "LaunchTemplateConfigs": [
                {
                    "LaunchTemplateSpecification": {
                        "LaunchTemplateName": "my-launch-template",
                        "Version": "$Latest"
                    }
                }
            ],
            "TargetCapacitySpecification": {
                "TotalTargetCapacity": 2,
                "OnDemandTargetCapacity": 0,
                "SpotTargetCapacity": 2,
                "DefaultTargetCapacityType": "spot"
            },
            "TerminateInstancesWithExpiration": false,
            "Type": "maintain",
            "ReplaceUnhealthyInstances": false,
            "SpotOptions": {
                "AllocationStrategy": "capacity-optimized",
                "InstanceInterruptionBehavior": "terminate"
            },
            "OnDemandOptions": {
                "AllocationStrategy": "lowestPrice"
            }
        }
    ]
}
```

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

**EC2 플릿을 설명하려면**  
[Get-EC2FleetList](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2FleetList.html) cmdlet을 사용합니다.

```
Get-EC2FleetList `
    -FleetId fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
```

------

## EC2 Fleet의 모든 인스턴스 설명
<a name="describe-instances-in-ec2-fleet"></a>

반환되는 실행 중 인스턴스 목록은 주기적으로 새로 고쳐지며 최신 상태가 아닐 수도 있습니다.

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

**지정된 EC2 플릿의 인스턴스를 설명하려면**  
[describe-fleet-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-fleet-instances.html) 명령을 사용합니다.

```
aws ec2 describe-fleet-instances \
    --fleet-id fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
```

다음은 예제 출력입니다.

```
{
    "ActiveInstances": [
        {
            "InstanceId": "i-09cd595998cb3765e", 
            "InstanceHealth": "healthy", 
            "InstanceType": "m4.large", 
            "SpotInstanceRequestId": "sir-86k84j6p"
        }, 
        {
            "InstanceId": "i-09cf95167ca219f17", 
            "InstanceHealth": "healthy", 
            "InstanceType": "m4.large", 
            "SpotInstanceRequestId": "sir-dvxi7fsm"
        }
    ], 
    "FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
```

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

**지정된 EC2 플릿의 인스턴스를 설명하려면**  
[Get-EC2FleetInstanceList](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2FleetInstanceList.html) cmdlet을 사용합니다.

```
Get-EC2FleetInstanceList `
    -FleetId fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
```

------

## EC2 Fleet의 이벤트 기록 설명
<a name="describe-ec2-fleet-event-history"></a>

이벤트 기록의 이벤트에 대한 자세한 내용은 [EC2 Fleet 이벤트 유형](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-event-types) 섹션을 참조하세요.

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

**지정된 EC2 플릿에 대한 이벤트를 설명하려면**  
[describe-fleet-history](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-fleet-history.html) 명령을 사용합니다.

```
aws ec2 describe-fleet-history \
    --fleet-id fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
    --start-time 2020-06-01T00:00:00Z
```

다음은 예제 출력입니다.

```
{
    "HistoryRecords": [
        {
            "EventInformation": {
                "EventSubType": "submitted"
            },
            "EventType": "fleetRequestChange",
            "Timestamp": "2020-09-01T18:26:05.000Z"
        },
        {
            "EventInformation": {
                "EventSubType": "active"
            },
            "EventType": "fleetRequestChange",
            "Timestamp": "2020-09-01T18:26:15.000Z"
        },
        {
            "EventInformation": {
                "EventDescription": "t2.small, ami-07c8bc5c1ce9598c3, ...",
                "EventSubType": "progress"
            },
            "EventType": "fleetRequestChange",
            "Timestamp": "2020-09-01T18:26:17.000Z"
        },
        {
            "EventInformation": {
                "EventDescription": "{\"instanceType\":\"t2.small\", ...}",
                "EventSubType": "launched",
                "InstanceId": "i-083a1c446e66085d2"
            },
            "EventType": "instanceChange",
            "Timestamp": "2020-09-01T18:26:17.000Z"
        },
        {
            "EventInformation": {
                "EventDescription": "{\"instanceType\":\"t2.small\", ...}",
                "EventSubType": "launched",
                "InstanceId": "i-090db02406cc3c2d6"
            },
            "EventType": "instanceChange",
            "Timestamp": "2020-09-01T18:26:17.000Z"
        }
    ], 
    "FleetId": "fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", 
    "LastEvaluatedTime": "1970-01-01T00:00:00.000Z", 
    "StartTime": "2020-06-01T00:00:00.000Z"
}
```

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

**지정된 EC2 플릿에 대한 이벤트를 설명하려면**  
[Get-EC2FleetHistory](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2FleetHistory.html) cmdlet을 사용합니다.

```
Get-EC2FleetHistory `
    -FleetId fleet-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE `
    -UtcStartTime 2020-06-01T00:00:00Z
```

------