AWS SSM put parameter Validation Exception

Viewed 14292

I am getting error when I execute the below command. But as far as I have googled, I see the syntax is correct.

Command 1:

aws ssm put-parameter --name /Finance/Payroll/elixir3131 --value "P@sSwW)rd" --type SecureString

Command 2:

aws ssm put-parameter --name "/Finance/Payroll/elixir3131" --value "P@sSwW)rd" --type SecureString

for both the commands I get :

An error occurred (ValidationException) when calling the PutParameter operation: Parameter name must be a fully qualified name.

AWS CLI Version : aws-cli/1.14.16 Python/2.7.9 Windows/7 botocore/1.8.20
5 Answers

I have had the same issue using Git-Bash on Windows 10

One way around this 'feature' is to use the --cli-input-json

e.g.

aws ssm put-parameter --cli-input-json '{"name": "/Finance/Payroll/elixir3131", "value": "P@sSwW)rd", "type": "SecureString"}'

There does seem to be some discussion about this feature/issue (and the above solution) here: https://github.com/aws/aws-cli/issues/2507

EDIT: This is the correct command:

aws ssm put-parameter --cli-input-json '{\"Name\": \"/Finance/Payroll/elixir3131d\", \"Value\": \"P@sSwW)rd\", \"Type\": \"SecureString\"}'

I was getting the same error using aws-sdk npm package:

ValidationException: Parameter name must be a fully qualified name.

If the Name parameter contains /, it must also start with a /.

Here is a confirmed working typescript example (assuming AWS_PROFILE and AWS_REGION env variables are set):

#!/usr/bin/env ts-node

import * as AWS from 'aws-sdk'

const secret = {
  Name: "/Finance/Payroll/elixir3131",
  Value: "P@sSwW)rd",
  Type: "SecureString"
}

const ssm = new AWS.SSM()

ssm.putParameter(secret, (err, data) => {
  if (err) {
    console.log(err, err.stack);
  } else {
    console.log(data);
  }
});

Response should look like this:

{ Version: 1, Tier: 'Standard' }

I tried both of your commands. No problems on Windows 10 x64 Pro.

AWS Systems Manager has changed a lot recently. I would upgrade your version of the AWS CLI and try again. Your version was released on Dec-22-2017. The current version is 1.16.38 (10-19-2018).

aws-cli/1.16.15 Python/3.6.1 Windows/10 botocore/1.12.5

Installing the AWS Command Line Interface

None of the commands in Tim Sibley's answer worked for me, but

aws ssm put-parameter --cli-input-json '{"Name": "/Finance/Payroll/elixir3131", "Value": "P@sSwW)rd", "Type": "SecureString"}'

did.

This command is the same as the first command on that answer but with "name", "value" and "type" capitalized.

I know this is already marked answered, but the --cli-input-json solution didn't work for me, as I needed to pass a file name for the value and have that file's contents be read out into the parameter. For me, the issue was also in Git bash on Windows, and the problem is because Git bash tries to find anything starting with / and put a system path before it. My workaround is to enclose the name field in double quotes and put a space before the first / so that Git Bash will ignore it. Looks like this

aws ssm put-parameter --name " /my/parameter/store/path/here" --value "somevalue" --type "SecureString"
Related