Published messages from SNS to SQS has a slightly different payload structure
than regular SNS messages, and when sent to SQS, they are stringified into the
body field of each SQS record.
To parse the Message field of the SNS notification, we need to:
Parse SQS schema with incoming data
JSON.parse() the SNS payload and parse against SNS Notification schema
Finally, parse the payload against the provided schema
SNS plus SQS Envelope to extract array of Records
Published messages from SNS to SQS has a slightly different payload structure than regular SNS messages, and when sent to SQS, they are stringified into the
body
field of each SQS record.To parse the
Message
field of the SNS notification, we need to:JSON.parse()
the SNS payload and parse against SNS Notification schema