@@ -26,7 +26,7 @@ export const process: ProcessMethod<SnsConfig, SnsEvent, Context, any> = (snsCon
2626 }
2727
2828 const sns = event . Records [ 0 ] . Sns
29- for ( let routeConfig of snsConfig . routes ) {
29+ for ( const routeConfig of snsConfig . routes ) {
3030 if ( routeConfig . subject instanceof RegExp ) {
3131 if ( routeConfig . subject . test ( sns . Subject ) ) {
3232 const result = routeConfig . action ( sns , context )
@@ -65,17 +65,30 @@ const cfgExample = {
6565 "EventVersion": "1.0",
6666 "EventSubscriptionArn": "arn:aws:sns:eu-west-1:933782373565:production-escenic-updates:2fdd994c-f2b7-4c2f-a2f9-da83b590e0fc",
6767 "Sns": {
68- "Type": "Notification",
69- "MessageId": "0629603b-448e-5366-88b4-309d651495c5",
70- "TopicArn": "arn:aws:sns:eu-west-1:933782373565:production-escenic-updates",
71- "Subject": null,
72- "Message": "{\"escenicId\":\"159526803\",\"model\":\"news\",\"status\":\"draft\"}",
73- "Timestamp": "2016-11-16T08:56:58.227Z",
74- "SignatureVersion": "1",
75- "Signature": "dtXM9BlAJJhYkVObnKmzY012kjgl4uYHEPQ1DLUalBHnPNzkDf12YeVcvHmq0SF6QbdgGwSYw0SgtsOkBiW3WSxVosqEb5xKUWIbQhlXwKdZnzekUigsgl3d231RP+9U2Cvd4QUc6klH5P+CuQM/F70LBIIv74UmR2YNMaxWxrv7Q+ETmz/TF6Y5v8Ip3+GLikbu6wQ/F5g3IHO2Lm7cLpV/74odm48SQxoolh94TdgvtYaUnxNjFVlF8Js8trbRkr7DYTogh73cTwuR77Mo+K9GlYn53txiMW5rMl3KhVdw4U3L190gtBJVwgHbqcB60pmNdEAE9f4bEOohizfPhg==",
76- "SigningCertUrl": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-b95095beb82e8f6a046b3aafc7f4149a.pem",
77- "UnsubscribeUrl": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:933782373565:production-escenic-updates:2fdd994c-f2b7-4c2f-a2f9-da83b590e0fc",
78- "MessageAttributes": {}
68+ "Type": "Notification",
69+ "MessageId": "0629603b-448e-5366-88b4-309d651495c5",
70+ "TopicArn": "arn:aws:sns:eu-west-1:933782373565:production-escenic-updates",
71+ "Subject": null,
72+ "Message": "{\"escenicId\":\"159526803\",\"model\":\"news\",\"status\":\"draft\"}",
73+ "Timestamp": "2016-11-16T08:56:58.227Z",
74+ "SignatureVersion": "1",
75+ "Signature": "dtXM9BlAJJhYkVObnKgHbqcB60pmNdEAE9f4bEOohizfPhg==",
76+ "SigningCertUrl": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-b95095beb82e8f6a046b3aafc7f4149a.pem",
77+ "UnsubscribeUrl": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:933782373565:production-escenic-updates:2fdd994c-f2b7-4c2f-a2f9-da83b590e0fc",
78+ "MessageAttributes": '{
79+ "stringAttribute": {
80+ "Type": "String",
81+ "Value": "stringvalue"
82+ },
83+ "binaryAttribute": {
84+ "Type": "Binary",
85+ "Value": "Ym9udmFsdWU="
86+ },
87+ "arrayAttribute": {
88+ "Type": "String",
89+ "Value": "[\"value1\", \"value2\"]"
90+ }
91+ }'
7992 }
8093 }
8194 ]
0 commit comments