aws-cli
                                
                                
                                
                                    aws-cli copied to clipboard
                            
                            
                            
                        SQS Message Attributes Shorthand error
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 - 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.
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.
Checking to see if this is still an issue.
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.
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.