Why am I getting an error when querying SSM parameters via get-parameters-by-path?

故事扮演 提交于 2020-12-15 05:18:22

问题


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
...

I am getting the following error back:

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?


回答1:


If you're using MSYS-based bash on Windows, make sure you prefix with MSYS2_ARG_CONV_EXCL=* to prevent it from expanding /prefix/prefix2 to a windows path.




回答2:


If you are using a Windows based command use:

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

(Double slash)

That solved my issue on Windows.



来源:https://stackoverflow.com/questions/63849127/why-am-i-getting-an-error-when-querying-ssm-parameters-via-get-parameters-by-pat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!