为什么通过get-parameters-by-path查询SSM参数时会出现错误? [英] Why am I getting an error when querying SSM parameters via get-parameters-by-path?

查看:190
本文介绍了为什么通过get-parameters-by-path查询SSM参数时会出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过路径(在Gitbash中)查询一些SSM参数:

I am trying to query some SSM parameters by path (within Gitbash):

aws --region eu-west-2 --profile some-profile ssm get-parameters-by-path --path /prefix/prefix2

存在许多与此前缀匹配的参数,例如

There are a number of parameters that exist which match this prefix, e.g.

/prefix/prefix2/p1
/prefix/prefix2/p2
...

我收到以下错误消息:

调用时发生错误(ValidationException)GetParametersByPath操作:参数不符合参数名称要求.参数名称必须以正斜杠"/".它不能以"aws"作为前缀或"ssm"(不区分大小写).它只能使用字母,数字或以下符号:.(句号),-(连字符),_(下划线).特别的不允许使用字符.如果指定了所有子路径,则必须使用正斜杠符号"/".有效的例子:/get/parameters2-/by1./path0 _.

An error occurred (ValidationException) when calling the GetParametersByPath operation: The parameter doesn't meet the parameter name requirements. The parameter name must begin with a forward slash "/". It can't be prefixed with "aws" or "ssm" (case-insensitive). It must use only letters, numbers, or the following symbols: . (period), - (hyphen), _ (underscore). Special characters are not allowed. All sub-paths, if specified, must use the forward slash symbol "/". Valid example: /get/parameters2-/by1./path0_.

如果前缀以"/"结尾,则会出现相同的错误.是什么原因造成的?

I get the same error if the prefixes end in "/". What is the cause of the problem?

推荐答案

如果您使用的是基于Windows的命令,请使用:

If you are using a Windows based command use:

aws ssm get-parameters-by-path --path '//dev//another//path'

(双斜杠)

这解决了我在Windows上的问题.

That solved my issue on Windows.

这篇关于为什么通过get-parameters-by-path查询SSM参数时会出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆