这个命令对我来说很好,返回 23 个 AMI:
aws ssm get-parameters-by-path --path "/aws/service/ami-windows-latest" --region us-east-1
样本输出:
{
"Parameters": [
{
"Name": "/aws/service/ami-windows-latest/Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express",
"Type": "String",
"Value": "ami-0a2e90df8bb31df6f",
"Version": 29,
"LastModifiedDate": 1576555239.669,
"ARN": "arn:aws:ssm:us-east-1::parameter/aws/service/ami-windows-latest/Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express"
},
{
"Name": "/aws/service/ami-windows-latest/Windows_Server-2012-R2_RTM-Chinese_Simplified-64Bit-Base",
"Type": "String",
"Value": "ami-0bedade339716cc2b",
"Version": 48,
"LastModifiedDate": 1576555364.453,
"ARN": "arn:aws:ssm:us-east-1::parameter/aws/service/ami-windows-latest/Windows_Server-2012-R2_RTM-Chinese_Simplified-64Bit-Base"
},
...
我正在使用 Mac。如果您使用的是 Windows,您可能需要摆弄引号(甚至删除它们)。