https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/ec2\/describe-images.html<\/a><\/p>\n\u4eca\u56de\u306fAWS CLI\u306e\u3046\u3061\u6bd4\u8f03\u7684\u8981\u7d20\u306e\u9805\u76ee\u304c\u5c11\u306a\u304f\u69cb\u9020\u304c\u308f\u304b\u308a\u3084\u3059\u3044describe-images\u3067\u5404\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u5171\u901a\u3067\u4f7f\u7528\u51fa\u6765\u308bAmazon Linux\u306eAMI\u3092\u691c\u7d22\u5bfe\u8c61\u306b\u3057\u3066–query\u306e\u8a18\u8ff0\u4f8b\u3092\u8a18\u8f09\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
AWS CLI\u306e\u691c\u7d22\u7d50\u679c\u304c1\u4ef6\u306e\u5834\u5408\u306e\u4f8b<\/h3>\n
\u307e\u305a\u306fAMI\u30921\u4ef6\u306e\u307f\u6307\u5b9a\u3057\u3066–query\u306e\u4f8b\u3092\u793a\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002
\n\u4ee5\u4e0b\u306e\u8aac\u660e\u3067\u4f7f\u7528\u3059\u308bAMI: ami-383c1956(Amazon Linux AMI 2015.09.1 x86_64 HVM GP2)<\/p>\n
–query\u3092\u4f7f\u7528\u305b\u305a\u691c\u7d22\u7d50\u679c\u3092\u305d\u306e\u307e\u307e\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
AWS CLI\u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306e\u300cOutput\u300d\u306e\u69cb\u9020\u8aac\u660e\u3067\u308f\u304b\u308a\u306b\u304f\u3044\u5834\u5408\u306f\u691c\u7d22\u7d50\u679c\u304c1\u4ef6\u306b\u306a\u308b\u3088\u3046\u306b\u3057\u3066\u3001\u3053\u306e\u3088\u3046\u306b\u5b9f\u969b\u306b\u691c\u7d22\u3057\u3066\u5177\u4f53\u7684\u306a\u69cb\u9020\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json\r\n{\r\n "Images": [\r\n {\r\n "VirtualizationType": "hvm", \r\n "Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2", \r\n "Hypervisor": "xen", \r\n "ImageOwnerAlias": "amazon", \r\n "SriovNetSupport": "simple", \r\n "ImageId": "ami-383c1956", \r\n "State": "available", \r\n "BlockDeviceMappings": [\r\n {\r\n "DeviceName": "\/dev\/xvda", \r\n "Ebs": {\r\n "DeleteOnTermination": true, \r\n "SnapshotId": "snap-09677294", \r\n "VolumeSize": 8, \r\n "VolumeType": "gp2", \r\n "Encrypted": false\r\n }\r\n }\r\n ], \r\n "Architecture": "x86_64", \r\n "ImageLocation": "amazon\/amzn-ami-hvm-2015.09.1.x86_64-gp2", \r\n "RootDeviceType": "ebs", \r\n "OwnerId": "137112412989", \r\n "RootDeviceName": "\/dev\/xvda", \r\n "CreationDate": "2015-10-29T18:13:04.000Z", \r\n "Public": true, \r\n "ImageType": "machine", \r\n "Description": "Amazon Linux AMI 2015.09.1 x86_64 HVM GP2"\r\n }\r\n ]\r\n}\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306e\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u4f8b\u3002<\/h4>\n
\u4e0a\u8a18\u306eJSON\u69cb\u9020\u306e\u3088\u3046\u306bImages\u306f\u914d\u5217\u5185\u306b\u8981\u7d20\u3092\u6301\u3064\u5f62\u306a\u306e\u3067Images\u306e\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u306b\u306fImages[]\u3068[]\u3092\u3064\u3051\u3066\u914d\u5217\u578b\u3067\u793a\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query 'Images[]'\r\n[\r\n {\r\n "VirtualizationType": "hvm", \r\n "Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2", \r\n "Hypervisor": "xen", \r\n "ImageOwnerAlias": "amazon", \r\n "SriovNetSupport": "simple", \r\n "ImageId": "ami-383c1956", \r\n "State": "available", \r\n "BlockDeviceMappings": [\r\n {\r\n "DeviceName": "\/dev\/xvda", \r\n "Ebs": {\r\n "DeleteOnTermination": true, \r\n "SnapshotId": "snap-09677294", \r\n "VolumeSize": 8, \r\n "VolumeType": "gp2", \r\n "Encrypted": false\r\n }\r\n }\r\n ], \r\n "Architecture": "x86_64", \r\n "ImageLocation": "amazon\/amzn-ami-hvm-2015.09.1.x86_64-gp2", \r\n "RootDeviceType": "ebs", \r\n "OwnerId": "137112412989", \r\n "RootDeviceName": "\/dev\/xvda", \r\n "CreationDate": "2015-10-29T18:13:04.000Z", \r\n "Public": true, \r\n "ImageType": "machine", \r\n "Description": "Amazon Linux AMI 2015.09.1 x86_64 HVM GP2"\r\n }\r\n]\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306e\u5185\u5bb9\u306e\u5358\u4e00\u8981\u7d20(Name\u306e\u307f)\u3092\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
\u4e0a\u8a18\u306eJSON\u69cb\u9020\u306e\u3088\u3046\u306bImages\u306e\u5185\u5bb9\u306fBlockDeviceMappings\u4ee5\u5916\u914d\u5217\u69cb\u9020\u3067\u306f\u306a\u3044\u306e\u3067\u9805\u76ee\u540d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u8868\u793a\u3067\u304d\u307e\u3059\u3002
\nImages\u914d\u5217\u5185\u306eName\u9805\u76ee\u3092\u8868\u793a\u3059\u308b\u306b\u306fImages[].Name\u3068\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query 'Images[].Name'\r\n[\r\n "amzn-ami-hvm-2015.09.1.x86_64-gp2"\r\n]\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306e\u5185\u5bb9\u306e\u5358\u4e00\u8981\u7d20(Name\u306e\u307f)\u3092\u30ad\u30fc\u540d\u300cAMI Name\u300d\u3092\u3064\u3051\u3066\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
\u4e0a\u8a18\u306eJSON\u3067\u51fa\u529b\u3055\u308c\u308bName\u9805\u76ee\u306b\u30ad\u30fc\u540d\u3092\u4e0e\u3048\u308b\u306b\u306fImages[].{“AMI Name”: Name}\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query 'Images[].{"AMI Name": Name}'\r\n[\r\n {\r\n "AMI Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2"\r\n }\r\n]\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306b\u30ad\u30fc\u540d\u300cAMI\u300d\u3092\u3064\u3051\u3066\u5185\u5bb9\u306e\u5358\u4e00\u8981\u7d20(Name\u306e\u307f)\u3092\u30ad\u30fc\u540d\u300cAMI Name\u300d\u3092\u3064\u3051\u3066\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
Images\u914d\u5217\u306b\u30ad\u30fc\u540d\u3092\u4e0e\u3048\u308b\u306b\u306f{“AMI”: Images[].{“AMI Name”: Name}}\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query '{"AMI": Images[].{"AMI Name": Name}}'\r\n{\r\n "AMI": [\r\n {\r\n "AMI Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2"\r\n }\r\n ]\r\n}\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306e\u5148\u982d\u8981\u7d20(0\u756a\u76ee)\u306b\u30ad\u30fc\u540d\u300cAMI\u300d\u3092\u3064\u3051\u3066\u5185\u5bb9\u306e\u5358\u4e00\u8981\u7d20(Name\u306e\u307f)\u3092\u30ad\u30fc\u540d\u300cAMI Name\u300d\u3092\u3064\u3051\u3066\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
\u4eca\u56de\u306e\u4f8b\u306e\u5834\u5408Images\u914d\u5217\u306e\u8981\u7d20\u306f1\u500b\u3067\u3001Images\u306e\u914d\u5217\u8981\u7d20\u30921\u3064\u306e\u307f\u53d6\u308a\u51fa\u3057\u3066\u914d\u5217\u69cb\u9020\u3067\u306f\u306a\u3044\u8868\u8a18\u306b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002
\n\u305d\u306e\u305f\u3081\u306b\u306fImages[0]\u306e\u3088\u3046\u306b\u914d\u5217\u306e\u8981\u7d20\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query '{"AMI": Images[0].{"AMI Name": Name}}'\r\n{\r\n "AMI": {\r\n "AMI Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2"\r\n }\r\n}\r\n<\/pre>\nJSON\u914d\u5217\u300cImages\u300d\u306e\u5148\u982d\u8981\u7d20(0\u756a\u76ee)\u306e\u5185\u5bb9\u306e\u5358\u4e00\u8981\u7d20(Name\u306e\u307f)\u3092\u30ad\u30fc\u540d\u300cAMI Name\u300d\u3092\u3064\u3051\u3066\u8868\u793a\u3059\u308b\u4f8b<\/h4>\n
Images\u306e\u914d\u5217\u8981\u7d20\u30921\u3064\u306e\u307f\u53d6\u308a\u51fa\u3057\u3066\u914d\u5217\u69cb\u9020\u3067\u306f\u306a\u3044\u8868\u8a18\u306b\u3057\u3001Name\u9805\u76ee\u306b\u30ad\u30fc\u540d\u3092\u3064\u3051\u3066\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]$ aws ec2 describe-images --image-id ami-383c1956 --output json --query '{"AMI Name": Images[0].Name}'\r\n{\r\n "AMI Name": "amzn-ami-hvm-2015.09.1.x86_64-gp2"\r\n}\r\n<\/pre>\n\u7d9a\u3044\u3066\u306fImages\u914d\u5217\u5185\u306eName\u9805\u76ee\u306b\u52a0\u3048\u3066ImageId\u3068\u3044\u3046\u9805\u76ee\u3092\u8868\u793a\u3059\u308b\u4f8b\u3092\u8a18\u8f09\u3057\u3066\u3044\u304d\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u4e0a\u8a18\u3067\u8aac\u660e\u3057\u305fName\u306e\u307f\u306e\u9805\u76ee\u306e\u8868\u793a\u3068\u540c\u69d8\u3067\u3059\u3002<\/p>\n