通过 describe_instances() 调用获取 ec2 的“ImageId”ami id。
然后使用“describe-images”调用 ie 来查找 ami
$ aws --region eu-west-1 ec2 describe-images --image-ids ami-4ac6653d
{
"Images": [
{
"ProductCodes": [
{
"ProductCodeId": "aacglxeowvn5hy8sznltowyqe",
"ProductCodeType": "marketplace"
}
],
"Name": "CentOS 6 x86_64 (2014_09_29) EBS pv-1-adc4348e-1dc3-41df-b833-e86ba57a33d6-ami-809020e8.2",
"VirtualizationType": "paravirtual",
"Hypervisor": "xen",
"ImageOwnerAlias": "aws-marketplace",
"ImageId": "ami-4ac6653d",
"RootDeviceType": "ebs",
"State": "available",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda",
"Ebs": {
"DeleteOnTermination": false,
"SnapshotId": "snap-8a6c3e70",
"VolumeSize": 8,
"VolumeType": "standard",
"Encrypted": false
}
}
],
"Architecture": "x86_64",
"ImageLocation": "aws-marketplace/CentOS 6 x86_64 (2014_09_29) EBS pv-1-adc4348e-1dc3-41df-b833-e86ba57a33d6-ami-809020e8.2",
"KernelId": "aki-52a34525",
"OwnerId": "679593333241",
"RootDeviceName": "/dev/sda",
"CreationDate": "2014-10-02T20:01:16.000Z",
"Public": true,
"ImageType": "machine",
"Description": "CentOS 6 x86_64 (2014_09_29) EBS PV-1"
}
]
}
这将提供有关操作系统的信息以及是否附带许可软件
查找安装在正在运行的实例上的第 3 方软件需要不同的过程,不知道一般如何执行此操作