Amazon EC2 인스턴스 토폴로지의 예제
describe-instance-topology
파라미터나 필터 없이 describe-instance-topology
명령을 사용하면 지정된 리전에서 이 명령에 지원되는 인스턴스 유형과 일치하는 모든 인스턴스가 응답에 포함됩니다. --region
파라미터를 포함하거나 기본 리전을 설정하여 리전을 지정할 수 있습니다. 기본 리전 설정에 대한 자세한 내용은 Amazon EC2 리소스에 대한 리전 선택 섹션을 참조하세요.
지정된 인스턴스 ID 또는 배치 그룹 이름과 일치하는 인스턴스를 반환하는 파라미터를 포함할 수 있습니다. 지정된 인스턴스 유형이나 인스턴스 패밀리와 일치하는 인스턴스 또는 지정된 가용 영역 또는 로컬 영역의 인스턴스를 반환하는 필터를 포함할 수도 있습니다. 단일 파라미터 또는 필터나 파라미터와 필터 조합을 포함할 수 있습니다.
출력은 기본적으로 페이지당 최대 20개의 인스턴스로 페이지가 매겨집니다. --max-results
파라미터를 사용하여 페이지당 최대 100개의 인스턴스를 지정할 수 있습니다.
자세한 내용은 describe-instance-topology
필요한 권한
인스턴스 토폴로지를 설명하려면 다음 권한이 필요합니다.
-
ec2:DescribeInstanceTopology
예시
예제 1 - 인스턴스 ID
- AWS CLI
-
특정 인스턴스의 토폴로지를 설명하려면
--instance-ids
파라미터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 인스턴스 ID와 일치하는 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-west-2
\ --instance-idsi-1111111111example
i-2222222222example
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "GroupName": "HPC-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3214313214example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -InstanceId
i-1111111111example
,i-2222222222example
예제 2 - 배치 그룹 이름 파라미터
- AWS CLI
-
지정된 배치 그룹에 포함된 인스턴스의 토폴로지를 설명하려면
group-names
파라미터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 배치 그룹 중 하나에 있는 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-west-2
\ --group-namesML-group
HPC-group
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "GroupName": "HPC-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3214313214example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
지정된 배치 그룹에 포함된 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -GroupName
ML-group
,HPC-group
예제 3 - 인스턴스 유형 필터
지정된 인스턴스 유형(정확히 일치)을 기준으로 필터링하거나 인스턴스 패밀리(와일드카드 사용)를 기준으로 필터링할 수 있습니다. 지정된 인스턴스 유형 필터와 인스턴스 패밀리 필터를 조합할 수도 있습니다.
예제 3a - 지정된 인스턴스 유형에 대한 정확히 일치 필터
- AWS CLI
-
특정 인스턴스 유형을 사용하여 인스턴스의 토폴로지를 설명하려면
instance-type
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 인스턴스 유형의 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-west-2
\ --filters Name=instance-type,Values=trn1n.32xlarge
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 인스턴스 유형을 사용하여 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="instance-type"; Values="
trn1n.32xlarge
"}
예제 3b - 인스턴스 패밀리의 와일드카드 필터
- AWS CLI
-
특정 인스턴스 패밀리를 사용하여 인스턴스의 토폴로지를 설명하려면
instance-type
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 인스턴스 패밀리의 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-west-2
\ --filters Name=instance-type,Values=trn1*
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" }, { "InstanceId": "i-3333333333example", "InstanceType": "trn1.32xlarge", "NetworkNodes": [ "nn-1212121212example", "nn-1211122211example", "nn-1311133311example" ], "ZoneId": "usw2-az4", "AvailabilityZone": "us-west-2d" }, { "InstanceId": "i-444444444example", "InstanceType": "trn1.2xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-5434334334example", "nn-1235301234example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 인스턴스 패밀리를 사용하여 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="instance-type"; Values="
trn1*
"}
예제 3c - 조합된 인스턴스 패밀리와 정확히 일치 필터
- AWS CLI
-
특정 인스턴스 패밀리 또는 인스턴스 유형을 사용하여 인스턴스의 토폴로지를 설명하려면
instance-type
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 기준을 충족하는 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-west-2
\ --filters "Name=instance-type,Values=p4d*
,trn1n.32xlarge
"출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-4343434343example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 인스턴스 패밀리 또는 인스턴스 유형을 사용하여 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="instance-type"; Values="
p4d*
", "trn1n.32xlarge
"}
예제 4 - 영역 ID 필터
zone-id
필터를 사용하여 가용 영역 또는 로컬 영역을 기준으로 필터링할 수 있습니다. 가용 영역 필터와 로컬 영역 필터를 조합할 수도 있습니다.
예제 4a - 가용 영역 필터
- AWS CLI
-
특정 가용 영역에 있는 인스턴스의 토폴로지를 설명하려면
zone-id
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 가용 영역의 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-east-1
\ --filters Name=zone-id,Values=use1-az1
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3214313214example" ], "ZoneId": "use1-az1", "AvailabilityZone": "us-east-1a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 가용 영역에 있는 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="zone-id"; Values="
use1-az1
"}
예제 4b - 로컬 영역 필터
- AWS CLI
-
특정 로컬 영역에 있는 인스턴스의 토폴로지를 설명하려면
zone-id
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 로컬 영역의 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-east-1
\ --filters Name=zone-id,Values=use1-atl2-az1
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "use1-atl2-az1", "AvailabilityZone": "us-east-1-atl-2a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 로컬 영역에 있는 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="zone-id"; Values="
use1-atl2-az1
"}
예제 4c - 조합된 가용 영역 필터 및 로컬 영역 필터
- AWS CLI
-
특정 영역에 있는 인스턴스의 토폴로지를 설명하려면
zone-id
필터와 함께 describe-instance-topology명령을 사용합니다. 출력에는 지정된 영역 중 하나에 있는 인스턴스만 포함됩니다. aws ec2 describe-instance-topology \ --region
us-east-1
\ --filters Name=zone-id,Values=use1-az1
,use1-atl2-az1
출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "use1-atl2-az1", "AvailabilityZone": "us-east-1-atl-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3214313214example" ], "ZoneId": "use1-az1", "AvailabilityZone": "us-east-1a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 영역에 있는 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="zone-id"; Values="
use1-az1
", "use1-atl2-az1
"}
예제 5 - 인스턴스 유형 필터 및 영역 ID 필터
단일 명령으로 필터를 조합할 수 있습니다.
- AWS CLI
-
특정 인스턴스 유형, 인스턴스 패밀리 및 영역을 사용하여 인스턴스의 토폴로지를 설명하려면
instance-type
및zone-id
필터와 함께 describe-instance-topology명령을 사용합니다. 응답에는 지정된 인스턴스 유형에 해당하고 지정된 영역 중 하나에 있는 모든 인스턴스가 포함됩니다. aws ec2 describe-instance-topology \ --region
us-east-1
\ --filters "Name=instance-type,Values=p4d*
,trn1n.32xlarge
" \ "Name=zone-id,Values=use1-az1
,use1-atl2-az1
"출력의 예시는 다음과 같습니다.
{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "ML-group", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "use1-atl2-az1", "AvailabilityZone": "us-east-1-atl-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "trn1n.32xlarge", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3214313214example" ], "ZoneId": "use1-az1", "AvailabilityZone": "us-east-1a" } ], "NextToken": "SomeEncryptedToken" }
- PowerShell
-
특정 인스턴스 유형, 인스턴스 패밀리 및 영역을 사용하여 인스턴스의 토폴로지를 설명하려면
Get-EC2InstanceTopology cmdlet을 사용합니다.
Get-EC2InstanceTopology ` -Filter @{Name="instance-type"; Values="
p4d*
", "trn1n.32xlarge
"} ` @{Name="zone-id"; Values="use1-az1
", "use1-atl2-az1
"}