Skip to content

Issue with parsing SSM parameters #2405

@omahonyb

Description

@omahonyb

I was recently trying SSM, and found the following two issues with aws-cli when I copied the command from the AWS webpage:

aws ssm send-command --document-name "AWS-UpdateLinuxAmi" --document-description "Update a Linux AMI. By default this will update distribution packages and Amazon software." --instance-ids "i-0123456789" --parameters '{"TargetAmiName":["UpdateLinuxAmi_from_{{SourceAmiId}}on{{global:DATE_TIME}}"],"InstanceType":["t2.micro"],"PreUpdateScript":["none"],"PostUpdateScript":["none"],"IncludePackages":["all"],"ExcludePackages":["none"],"SourceAmiId":["ami-c51e3eb6"],"InstanceIamRole":["SystemsManagerEC2Role"],"AutomationAssumeRole":["SystemsManagerAutomationRole"]}' --timeout-seconds 600 --region eu-west-1
usage: aws [options] [ ...] [parameters]

If I leave in the --document-description I get:

Unknown options: --document-description, Update a Linux AMI. By default this will update distribution packages and Amazon software.

If I remove this, it seems to fall apart parsing the parameters:

"Error parsing parameter '--parameters': Expected: '=', received: ''' for input:
'{TargetAmiName:[UpdateLinuxAmi_from_{{SourceAmiId}}on{{global:DATE_TIME}}],InstanceType:[t2.micro],PreUpdateScript:[none],PostUpdateScript:[none],IncludePackages:[all],ExcludePackages:[none],SourceAmiId:[ami-c51e3eb6],InstanceIamRole:[SystemsManagerEC2Role],AutomationAssumeRole:[SystemsManagerAutomationRole]}'
^"

Any ideas what could be wrong? New to AWS CLI to be honest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closing-soonThis issue will automatically close in 4 days unless further comments are made.guidanceQuestion that needs advice or information.service-apiThis issue is due to a problem in a service API, not the SDK implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions