Search code examples
amazon-web-servicesaws-cliaws-ssm

AWS CLI SSM get-parameters InvalidParameters on Windows


I'm using

GitBash v2.17.0

AWS CLI v1.16.67

Windows 10

Problem

I've created a SecureString parameter in the AWS SSM Parameter Store. For sake of example, let's call the parameter

/levelOne/levelTwo  

I'm trying to retrieve the parameter using the AWS CLI. To do this I am using the following command:

aws ssm get-parameters --names '/levelOne/LevelTwo' --with-decryption  

The problem is that the result returned is this:

enter image description here

As you can see, the parameter is being prefixed with C:/Program Files/Git. Can anyone explain what I have done wrong please?

Thanks


Solution

  • This is caused by POSIX path conversion in MinGW.

    You can work around this by substituting // for the leading /, and then replacing the subsequent forward slashes with backslashes, e.g.

    aws ssm get-parameters --names '//levelOne\levelTwo'
    

    This command will only run correctly in MinGW, i.e. it will fail in Bash or Windows CMD.