从参数存储中获取的所有Windows服务器名称列表。

huangapple go评论59阅读模式
英文:

List of all windows server names from parameter store

问题

我有这个参数,并且它按预期工作。

参数:
LatestAmiId:
类型:'AWS::SSM::Parameter::ValueAWS::EC2::Image::Id'
默认值:/aws/service/ami-windows-latest/Windows_Server-2016-English-Core-Containers

但是,我如何获取所有Windows服务器的列表?以下命令不返回任何内容。

aws ssm get-parameters-by-path --path "/aws/service/ami-windows-latest" --region us-east-1

英文:

I have this parameter and it works as expected.

Parameters:
  LatestAmiId:
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: /aws/service/ami-windows-latest/Windows_Server-2016-English-Core-Containers

But how do I get the list of all windows servers? The following command does not return anything.

> aws ssm get-parameters-by-path --path "/aws/service/ami-windows-latest" --region us-east-1

答案1

得分: 1

这个命令对我来说运行正常,返回了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,您可能需要调整引号(甚至删除它们)。

英文:

This command works fine for me, returning 23 AMIs:

aws ssm get-parameters-by-path --path "/aws/service/ami-windows-latest" --region us-east-1

Sample output:

{
    "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"
        },
        ...

I'm using a Mac. If you are using Windows, you might need to fiddle with the quotation marks (or even remove them).

答案2

得分: 1

在Windows上也正常运行。

从参数存储中获取的所有Windows服务器名称列表。

英文:

Works fine on Windows as well.

从参数存储中获取的所有Windows服务器名称列表。

huangapple
  • 本文由 发表于 2020年1月4日 12:46:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/59587972.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定