AWS

Download 48
Last updated Jun 6, 2022

aws-ec2-instances

Describes all of AWS account's EC2 instances.

aws-ec2-instances [profile=PROFILE] [region=REGION]
profile=PROFILE
The identifier of AWS connect profile
region=REGION
AWS region

AWS IAM Policy

To use this command, you must allow the below permissions in your AWS IAM policy:

  • ec2:DescribeInstances

Output Fields

FieldTypeNameDescription
aws_profileStringConnect profileThe identifier of AWS connect profile
regionStringRegione.g. ap-northeast-2
azStringAvailability Zonee.g. ap-northeast-2a
instance_idStringInstance IDe.g. i-00123456789abcdef
instance_typeStringInstance typee.g. m5.xlarge
cpu_coresIntegerCPU corese.g. 2
state_codeIntegerState codee.g. 16, 80
state_nameStringState namee.g. running, stopped
state_reason_codeIntegerState reason codee.g. Client.UserInitiatedShutdown
state_reason_msgStringState reason messagee.g. Client.UserInitiatedShutdown: User initiated shutdown
public_ipIP addressPublic IP
private_ipIP addressPrivate IP
launched_atDateLaunched at
requester_idStringRequester ID
owner_idStringOwner ID
archStringArchitecturee.g. x86_64
iam_profile_idStringIAM profile ID
iam_profile_arnStringIAM profile ARN
key_nameStringKey name
vpc_idStringVPC ID
subnet_idStringSubnet ID
host_idStringHost ID
group_nameStringGroup name
image_idStringImage ID
kernel_idStringKernel ID
platformStringPlatform
virtualization_typeStringVirtualization typee.g. hvm
hypervisorStringHypervisore.g. xen
ami_launch_indexIntegerAMI launch indexe.g. 0
ena_supportBoolENA support
ebs_optimizedBoolEBS optimized
reservation_idStringReservation ID
public_dns_nameStringPublic DNS name
private_dns_nameStringPrivate DNS name
block_device_mappingsListBlock device mappingsElements with device_name, volume_id, delete_on_termination, attached_at, and status properties
security_groupsListSecurity groupsElements with group_id and group_name properties
gpu_associationsListGPU associationsElements with gpu_id, gpu_assoc_id, gpu_assoc_state, and gpu_assoc_time properties
tagsListTagsElements with key and value properties