Amazon EC2 인스턴스 토폴로지 예 - Amazon Elastic Compute Cloud

Amazon EC2 인스턴스 토폴로지 예

describe-instance-topology CLI 명령을 사용하여 EC2 인스턴스의 인스턴스 토폴로지를 설명할 수 있습니다.

파라미터나 필터 없이 describe-instance-topology 명령을 사용하면 지정된 리전에서 이 명령에 지원되는 인스턴스 유형과 일치하는 모든 인스턴스가 응답에 포함됩니다. --region 파라미터를 포함하거나 기본 리전을 설정하여 리전을 지정할 수 있습니다. 기본 리전 설정에 대한 자세한 내용은 리소스에 대한 리전 지정 섹션을 참조하세요.

지정된 인스턴스 ID 또는 배치 그룹 이름과 일치하는 인스턴스를 반환하는 파라미터를 포함할 수 있습니다. 지정된 인스턴스 유형이나 인스턴스 패밀리와 일치하는 인스턴스 또는 지정된 가용 영역 또는 로컬 영역의 인스턴스를 반환하는 필터를 포함할 수도 있습니다. 단일 파라미터 또는 필터나 파라미터와 필터 조합을 포함할 수 있습니다.

출력은 기본적으로 페이지당 최대 20개의 인스턴스로 페이지가 매겨집니다. --max-results 파라미터를 사용하여 페이지당 최대 100개의 인스턴스를 지정할 수 있습니다.

자세한 내용은 AWS CLI 명령 레퍼런스describe-instance-topology 섹션을 참조하세요.

필요한 권한

인스턴스 토폴로지를 설명하려면 다음 권한이 필요합니다.

  • ec2:DescribeInstanceTopology

예제 1 - 파라미터 또는 필터 없음

모든 인스턴스의 인스턴스 토폴로지 설명

파라미터나 필터를 지정하지 않고 describe-instance-topology CLI 명령을 사용합니다.

aws ec2 describe-instance-topology --region us-west-2

응답은 이 API에 대해 지원되는 인스턴스 유형과 일치하는 인스턴스만 반환합니다. 인스턴스는 서로 다른 가용 영역, 로컬 영역(ZoneId) 및 배치 그룹(GroupName)에 있을 수 있습니다. 인스턴스가 배치 그룹에 없으면 GroupName 필드가 출력에 표시되지 않습니다. 다음 예제 출력에서는 배치 그룹에 하나의 인스턴스만 있습니다.

출력 예시

{ "Instances": [ { "InstanceId": "i-1111111111example", "InstanceType": "p4d.24xlarge", "GroupName": "my-ml-cpg", "NetworkNodes": [ "nn-1111111111example", "nn-2222222222example", "nn-3333333333example" ], "ZoneId": "usw2-az2", "AvailabilityZone": "us-west-2a" }, { "InstanceId": "i-2222222222example", "InstanceType": "p4d.24xlarge", "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" }

예제 2 - 인스턴스 유형 필터

지정된 인스턴스 유형(정확히 일치)을 기준으로 필터링하거나 인스턴스 패밀리(와일드카드 사용)를 기준으로 필터링할 수 있습니다. 지정된 인스턴스 유형 필터와 인스턴스 패밀리 필터를 조합할 수도 있습니다.

예제 2a - 지정된 인스턴스 유형에 대한 정확히 일치 필터

지정된 인스턴스 유형과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

instance-type 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 trn1n.32xlarge 인스턴스에 대해 출력이 필터링됩니다. 응답은 지정된 인스턴스 유형과 일치하는 인스턴스만 반환합니다.

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" }

예제 2b - 인스턴스 패밀리의 와일드카드 필터

인스턴스 패밀리와 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

instance-type 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 trn1* 인스턴스에 대해 출력이 필터링됩니다. 응답은 지정된 인스턴스 유형과 일치하는 인스턴스만 반환합니다.

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" }

예제 2c - 조합된 인스턴스 패밀리와 정확히 일치 필터

인스턴스 패밀리 또는 지정된 인스턴스 유형과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

instance-type 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 pd4d* 또는 trn1n.32xlarge 인스턴스에 대해 출력이 필터링됩니다. 응답은 지정된 필터와 일치하는 인스턴스를 반환합니다.

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" }

예제 3 - zone-id 필터

zone-id 필터를 사용하여 가용 영역 또는 로컬 영역을 기준으로 필터링할 수 있습니다. 가용 영역 필터와 로컬 영역 필터를 조합할 수도 있습니다.

예제 3a - 가용 영역 필터

지정된 가용 영역과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

zone-id 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 가용 영역 ID use1-az1에 대해 출력이 필터링됩니다. 응답은 지정된 가용 영역과 일치하는 인스턴스만 반환합니다.

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" }

예제 3b - 로컬 영역 필터

지정된 로컬 영역과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

zone-id 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 로컬 영역 ID use1-atl2-az1에 대해 출력이 필터링됩니다. 응답은 지정된 로컬 영역과 일치하는 인스턴스만 반환합니다.

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" }

예제 3c - 조합된 가용 영역과 로컬 영역 필터

지정된 가용 영역 또는 로컬 영역과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

zone-id 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 가용 영역 ID use1-az1과 로컬 영역 ID use1-atl2-az1에 대해 출력이 필터링됩니다. 응답은 지정된 필터와 일치하는 인스턴스를 반환합니다.

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" }

예제 4 - 조합된 인스턴스 유형 필터와 zone-id 필터

단일 명령으로 모든 필터를 조합할 수 있습니다.

지정된 인스턴스 유형, 인스턴스 패밀리, 가용 영역 또는 로컬 영역과 일치하는 모든 인스턴스의 인스턴스 토폴로지 설명

instance-typezone-id 필터와 함께 describe-instance-topology CLI 명령을 사용합니다. 이 예제에서는 p4d* 인스턴스 패밀리, trn1n.32xlarge 인스턴스 유형, use1-az1 가용 영역 ID 및 use1-atl2-az1 로컬 영역 ID에 대해 출력이 필터링됩니다. 응답은 us-east-1a 또는 us-east-1-atl-2a 영역의 p4d* 또는 trn1n.32xlarge 인스턴스와 일치하는 인스턴스를 반환합니다.

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" }

예제 5 - 배치 그룹 이름 파라미터

지정된 배치 그룹에 있는 모든 인스턴스의 인스턴스 토폴로지 설명

group-names 파라미터와 함께 describe-instance-topology CLI 명령을 사용합니다. 다음 예제에서는 인스턴스가 ML-group 또는 HPC-group 배치 그룹에 속할 수 있습니다. 응답은 배치 그룹 중 하나에 있는 인스턴스를 반환합니다.

aws ec2 describe-instance-topology \ --region us-west-2 \ --group-names ML-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" }

예 6: 인스턴스 ID

지정된 인스턴스의 인스턴스 토폴로지 설명

--instance-ids 파라미터와 함께 describe-instance-topology CLI 명령을 사용합니다. 응답은 지정된 인스턴스 ID와 일치하는 인스턴스를 반환합니다.

aws ec2 describe-instance-topology \ --region us-west-2 \ --instance-ids i-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" }