AWS CLI 命令问题

AWS CLI Command Issue

我想计算我帐户中的实例总数,所以我 运行 使用以下命令:

get-discovered-resource-counts

但是它给我带来了以下错误:

'get-discovered-resource-counts' is not recognized as an internal or external command, operable program or batch file.

假设您已经安装了 AWS CLI(通过执行 aws --version 进行验证)并且 configured your access key id and secret access key 正确,您应该能够执行它:

aws configservice get-discovered-resource-counts

旁注,该命令只会 return 当前区域中的实例。如果您想查看其他地区的实例数量,可以使用 --region 参数提供。例如,如果您想知道您帐户在爱尔兰地区的当前状态,您可以使用 eu-west-1 作为值:

aws configservice get-discovered-resource-counts --region eu-west-1

AWS CLI 参考中的更多信息:aws configservice get-discovered-resource-counts