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

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?

8

3 Answers

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.

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.

1

For windows Git Bash, You need to use MSYS2_ARG_CONV_EXCL="*" in Environemnt variable (like mentioned by @Dylan Nicholson), or just use export as below

The exact code needed is as below

export MSYS2_ARG_CONV_EXCL="*" 

after that you can call the command normally as below

aws ssm describe-parameters --parameter-filters "Key=Name,Values=/dev/another/path" 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like