Amazon S3 目标的已存档消息格式 - Amazon Simple Notification Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

Amazon S3 目标的已存档消息格式

以下示例显示了发送到 Amazon Simple Storage Service (Amazon S3) 存储桶的 Amazon SNS 通知,并使用缩进以提高可读性。

注意

在此示例中,已发布消息的原始消息传输被禁用。禁用原始邮件传输时,Amazon SNS 会将 JSON 元数据添加到消息中,其中包括以下属性:

  • Type

  • MessageId

  • TopicArn

  • Subject

  • Timestamp

  • UnsubscribeURL

  • MessageAttributes

有关原始消息传输的更多信息,请参阅 Amazon SNS 原始消息传输

{ "Type": "Notification", "MessageId": "719a6bbf-f51b-5320-920f-3385b5e9aa56", "TopicArn": "arn:aws:sns:us-east-1:333333333333:my-kinesis-test-topic", "Subject": "My 1st subject", "Message": "My 1st body", "Timestamp": "2020-11-26T23:48:02.032Z", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:333333333333:my-kinesis-test-topic:0b410f3c-ee5e-49d8-b59b-3b4aa6d8fcf5", "MessageAttributes": { "myKey1": { "Type": "String", "Value": "myValue1" }, "myKey2": { "Type": "String", "Value": "myValue2" } } }

以下示例显示通过 Amazon Kinesis Data Firehose 传输流发送到同一 Amazon S3 存储桶的三条 SNS 消息。将缓冲考虑在内,并且换行符分隔消息。

{"Type":"Notification","MessageId":"d7d2513e-6126-5d77-bbe2-09042bd0a03a","TopicArn":"arn:aws:sns:us-east-1:333333333333:my-kinesis-test-topic","Subject":"My 1st subject","Message":"My 1st body","Timestamp":"2020-11-27T00:30:46.100Z","UnsubscribeURL":"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:313276652360:my-kinesis-test-topic:0b410f3c-ee5e-49d8-b59b-3b4aa6d8fcf5","MessageAttributes":{"myKey1":{"Type":"String","Value":"myValue1"},"myKey2":{"Type":"String","Value":"myValue2"}}} {"Type":"Notification","MessageId":"0c0696ab-7733-5bfb-b6db-ce913c294d56","TopicArn":"arn:aws:sns:us-east-1:333333333333:my-kinesis-test-topic","Subject":"My 2nd subject","Message":"My 2nd body","Timestamp":"2020-11-27T00:31:22.151Z","UnsubscribeURL":"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:313276652360:my-kinesis-test-topic:0b410f3c-ee5e-49d8-b59b-3b4aa6d8fcf5","MessageAttributes":{"myKey1":{"Type":"String","Value":"myValue1"}}} {"Type":"Notification","MessageId":"816cd54d-8cfa-58ad-91c9-8d77c7d173aa","TopicArn":"arn:aws:sns:us-east-1:333333333333:my-kinesis-test-topic","Subject":"My 3rd subject","Message":"My 3rd body","Timestamp":"2020-11-27T00:31:39.755Z","UnsubscribeURL":"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:313276652360:my-kinesis-test-topic:0b410f3c-ee5e-49d8-b59b-3b4aa6d8fcf5"}