查询 EC2 实例类型属性

Query EC2 instance type attributes

有没有办法从命令行aws工具中获取实例类型的核心数和内存量?

基本上我想以编程方式访问 http://aws.amazon.com/ec2/instance-types/ 上的数据。

不是官方的。但是不可思议的 Mitch Garnaat has a Github repository with "missingcloud" bits。该列表上是实例信息。你可以用你最喜欢的语言来挑选它。这是一个带有 jq 的示例。 (这是不完美的,也许有人可以帮助将它们分成 instance:ramMB 行?)

$ curl --silent https://raw.githubusercontent.com/garnaat/missingcloud/master/aws.json | jq '[.services."Elastic Compute Cloud".instance_types|to_entries|.[]|.key,.value.ramMB]' | head -9
[
  "c1.medium",
  1700,
  "c1.xlarge",
  7000,
  "c3.2xlarge",
  15000,
  "c3.4xlarge",
  30000,