aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

SQS Message Attributes Shorthand error

Open ldadams opened this issue 7 years ago • 7 comments

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!

ldadams avatar Oct 06 '18 14:10 ldadams

@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}"

justnance avatar Oct 21 '18 07:10 justnance

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.

tillkuhn avatar Oct 30 '19 14:10 tillkuhn

+1 @tillkuhn , the documentation is still lacking.

alam0rt avatar Apr 16 '20 05:04 alam0rt

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.

github-actions[bot] avatar Apr 16 '21 06:04 github-actions[bot]

Checking to see if this is still an issue.

kdaily avatar Apr 17 '21 00:04 kdaily

For anyone ending up here from debugging SNS message attributes, the above fix works for SNS too, yet the documentation still states the old syntax without the curly braces.

joodlehammond avatar Nov 22 '21 15:11 joodlehammond

Looks like it's a common problem for structure filed in a map. Structure filed should be wrapped with curly brace in the map. Looking into it.

wangshu3000 avatar Aug 29 '22 06:08 wangshu3000