Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

I'm not getting shorthand syntax for the "--message-attributes" parameter to work when sending messages using AWS CLI for SQS. The Commands that I used are below,

aws sqs send-message \

--queue-url https://sqs.us-east-1.amazonaws.com/0000000000/aa_queue_name \

--message-body "message body goes here" \

--message-attributes firstAttribute={DataType=String,StringValue="hello world"},secondAttribute={DataType=String,StringValue="goodbye world"}

And I'm getting this error:

Parameter validation failed: Invalid type for parameter MessageAttributes.contentType, value: StringValue=Snapshot, type: , valid types:

Any solution?

1 Answer

0 votes
by (12.4k points)

Here you can use inline JSON, like:

aws sqs send-message 

  --queue-url https://sqs.us-east-1.amazonaws.com/0000000000/aa_queue_name 

  --message-body "message body goes here" 

  --message-attributes '{ "firstAttribute":{ "DataType":"String","StringValue":"hello world" }, "secondAttribute":{ "DataType":"String","StringValue":"goodbye world"} }'

This will work for you.

Want to learn more about AWS, Come & Join: AWS Online training

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
asked Nov 22, 2020 in AWS by devin (5.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...