Aws-cli: SQS Message Attributes Shorthand error

Created on 6 Oct 2018  路  3Comments  路  Source: aws/aws-cli

I am getting the below error trying to send SQS message attributes via shorthand syntax. I have tried a number of different ways with same result.

aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/{account-id}/{queue} --message-body TestBody --message-attributes 'TenantID=StringValue=TestTenant,DataType=String

Parameter validation failed:
Invalid type for parameter MessageAttributes.DataType, value: String, type: <type 'unicode'>, valid types: <type 'dict'>
Invalid type for parameter MessageAttributes.TenantID, value: StringValue=TestTenant, type: <type 'unicode'>, valid types: <type 'dict'>

Thanks!

documentation

Most helpful comment

@ldadams - Thank you for reaching out. It appears our documentation needs some work. Please try this command as workaround while I investigate this issue further:

aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/310949364363/etl-upload-tus --message-body TestBody --message-attributes "TenantID={StringValue=TestTenant,DataType=String}"

All 3 comments

@ldadams - Thank you for reaching out. It appears our documentation needs some work. Please try this command as workaround while I investigate this issue further:

aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/310949364363/etl-upload-tus --message-body TestBody --message-attributes "TenantID={StringValue=TestTenant,DataType=String}"

Thanks @ldadams, I just ran into the same issue and your hint worked for me. Note that the AWS CLI docs on sns publish still don't mention that you have to use curly brackets in the Shorthand Syntax.

+1 @tillkuhn , the documentation is still lacking.

Was this page helpful?
0 / 5 - 0 ratings