问题
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