By using AWS re:Post, you agree to the Terms of Use
/Amazon Simple Notification Service (SNS)/

Questions tagged with Amazon Simple Notification Service (SNS)

Sort by most recent
  • 1
  • 90 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

0
answers
0
votes
12
views
asked 17 hours ago

Unit value in RDS CloudWatch Alarm is Null

Hello, I have been trying to obtain a value from an SNS message passed from a CloudWatch Alarm for the DatabaseConnections Metric. The value of the Unit is null hence I cannot parse the message to obtain the DBIdentifier value. Is there a reason why the CloudWatch alarm does not have a value for the Unit? Looking at the AWS RDS documentation, the value for DatabaseConnections Metric, Unit should be Count but the alarm gives null. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-metrics.html#rds-cw-metrics-instance Below is the message obtained from the SNS message body: ``` { "AlarmName": "awsrds-poc-test-High-DB-Connections", "AlarmDescription": "When the DB-Connections is lower than 1", "AWSAccountId": "<##########>", "AlarmConfigurationUpdatedTimestamp": "2022-06-17T08:54:32.735+0000", "NewStateValue": "ALARM", "NewStateReason": "Threshold Crossed: 1 out of the last 1 datapoints [0.0 (17/06/22 08:50:00)] was less than the threshold (1.0) (minimum 1 datapoint for OK -> ALARM transition).", "StateChangeTime": "2022-06-17T08:55:15.402+0000", "Region": "US East (N. Virginia)", "AlarmArn": "arn:aws:cloudwatch:us-east-1:678932343753:alarm:awsrds-poc-test-High-DB-Connections", "OldStateValue": "OK", "OKActions": [], "AlarmActions": [ "arn:aws:sns:us-east-1:678932343753:sns-alarm" ], "InsufficientDataActions": [], "Trigger": { "MetricName": "DatabaseConnections", "Namespace": "AWS/RDS", "StatisticType": "Statistic", "Statistic": "AVERAGE", "Unit": null, "Dimensions": [ { "value": "<######>", "name": "DBInstanceIdentifier" } ], "Period": 300, "EvaluationPeriods": 1, "DatapointsToAlarm": 1, "ComparisonOperator": "LessThanThreshold", "Threshold": 1, "TreatMissingData": "", "EvaluateLowSampleCountPercentile": "" } } ```
0
answers
0
votes
31
views
asked 14 days ago

SMS never arrive from PHP API

Hello, I tested the SNS service to send SMS to france (my country) using the php api, it worked perfectly until I reach the limit. Then I asked amazon to use the service in production, they switch my account from the sandbox to production, I've been able to send one sms and nor more. When I try now I get a statusCode of 200 with a message ID but the message never arrives. This is my code: ``` $SnSclient = new SnsClient([ 'region' => 'eu-west-3', 'version' => 'latest', 'credentials' => [ 'key' => '**********************', 'secret' => '*************************************', ],]); $sms = "Simple test"; $phone = "+33123456789"; try { $result = $SnSclient->publish([ "MessageAttributes" => [ 'AWS.SNS.SMS.SMSType' => [ 'DataType' => 'String', 'StringValue' => 'Transactional' ] ], 'Message' => $sms, 'PhoneNumber' => $phone ]); } catch (AwsException $e) { print_r($e); } print_r($result); ``` The return is like that: ```Aws\Result Object ( [data:Aws\Result:private] => Array ( [MessageId] => 9d7489b2-3662-5b52-ad7c-d299afb0fcd4 [@metadata] => Array ( [statusCode] => 200 [effectiveUri] => https://sns.eu-west-3.amazonaws.com [headers] => Array ( [x-amzn-requestid] => 2de95f01-356e-5303-9b85-042aacbc0485 [content-type] => text/xml [content-length] => 294 [date] => Tue, 21 Jun 2022 10:04:01 GMT ) [transferStats] => Array ( [http] => Array ( [0] => Array ( ) ) ) ) ) [monitoringEvents:Aws\Result:private] => Array ( ) )``` What can I check ? Thanks
0
answers
0
votes
17
views
asked 15 days ago

Domain and Email Address Identity have different Feedback notification settings for different SNS topics but both of them go to the same topic as what is set for the domain identity

I have 2 verified identities: * domain.com (Domain) * account@domain.com (Email address) The reason for both is that I want email from account@domain.com to go to one SNS topic (Account Topic) while everything else in that domain goes to a different SNS topic (Domain Topic). That is the idea but the email sent from account@domain.com has its notifications go to the same SNS topic as domain.com. I know this should work because it is listed here [https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html]() > Verified email address identity settings override verified domain identity settings. **Note:** I am not in the sandbox **Troubleshooting** * Verified that each identity has different SNS Feedback notifications * Created a different-account@domain.com as a verified email address identity and set Bonce, Complaint, and Delivery notifications to go to the same SNS topic as account@domain.com (Account Topic) - this worked as expected with notifications going to the correct SNS topic (Account Topic) * Made sure that the character cases match for account@domain.com when sending email since email identities are case-sensitive * Deleted the Email address identity (account@domain.com), waiting 15 minutes, and then creating a new identity with the same account@domain.com address - the identity was immediately verified and still had the previous Bonce, Complaint, and Delivery settings as before which makes me think this account was never deleted off of AWS in the backend.
1
answers
0
votes
28
views
asked a month ago

Property Topics cannot be empty - Cloudformation CREATE_FAILED on SNS TopicPolicy

I'm trying to build a Cloudformation template using examples I find online. I ran into a dependency issue between S3 and SNS resources which led me to this AWS article: > [How do I avoid the "Unable to validate the following destination configurations" error in AWS CloudFormation](https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-destination-s3/) Using that as an example I created a parameterized S3 bucket name and SNS TopicPolicy, however on creating the Cloudformation stack I see `CREATE_FAILED` for the TopicPolicy with status `Property Topics cannot be empty.` My only attempt at a resolution was to add `DependsOn` to the TopicPolicy, a property that did not appear in the linked article above. My best guess is that `{"Ref": "TransactionUploadTopic"}` in the `Topics` array is not resolving to the ARN for `TransactionUploadTopic`, despite it being successfully created in the CF stack (so I don't know why this would be the case.) My template is below, I'm learning from the [AMediaManager Tutorial](https://aws.amazon.com/blogs/devops/part-1-develop-deploy-and-manage-for-scale-with-elastic-beanstalk-and-cloudformation-series/) ([GitHub Repo](https://github.com/amazon-archives/amediamanager)) and other online resources (since my architecture is quite different from the AMM tutorial.) ``` { "AWSTemplateFormatVersion": "2010-09-09", "Description": "Provision resource dependencies for the app (e.g., RDS, S3, DynamoDB, etc..).", "Parameters": { "AppBucketNameSuffix": { "Description": "The S3 bucket for user uploads", "Type": "String" } }, "Resources": { "InstanceSecurityGroup": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupDescription": "RDS allows ingress from EC2 instances in this group.", "SecurityGroupIngress": [] } }, "TransactionUploadQueue": { "Type": "AWS::SQS::Queue" }, "TransactionUploadTopic": { "Type": "AWS::SNS::Topic", "Properties": { "Subscription": [{ "Endpoint": { "Fn::GetAtt": ["TransactionUploadQueue", "Arn"] }, "Protocol": "sqs" }] } }, "AppBucket2SNSPolicy": { "Type": "AWS::SNS::TopicPolicy", "DependsOn": ["TransactionUploadTopic"], "Properties": { "PolicyDocument": { "Id": "S3NotificationPolicy", "Version": "2012-10-17", "Statement": [ { "Sid": "Statement-id", "Effect": "Allow", "Principal": {"Service": "s3.amazonaws.com"}, "Action": "sns:Publish", "Resource": {"Ref": "TransactionUploadTopic"}, "Condition": { "ArnLike": { "aws:SourceArn": {"Fn::Join": [ "", [ "arn:aws:s3:::", {"Ref": "AWS::StackName"}, "-", {"Ref": "AppBucketNameSuffix"} ]]} } } } ], "Topics": [ {"Ref": "TransactionUploadTopic"} ] } } }, "AppBucket": { "Type": "AWS::S3::Bucket", "DependsOn": ["AppBucket2SNSPolicy"], "Properties": { "BucketName": {"Fn::Join": ["-", [{"Ref": "AWS::StackName"}, {"Ref": "AppBucketNameSuffix"}]]}, "NotificationConfiguration": { "TopicConfigurations": [ { "Event": "s3:ObjectCreated:*", "Topic": {"Ref": "TransactionUploadTopic"} } ] } } }, "TransactionUploadTopic2QueuePolicy": { "Type": "AWS::SQS::QueuePolicy", "Properties": { "Queues": [{ "Ref": "TransactionUploadQueue" }], "PolicyDocument": { "Version": "2012-10-17", "Id": "PublicationPolicy", "Statement": [{ "Sid": "Allow-SNS-SendMessage", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": ["sqs:SendMessage"], "Resource": { "Fn::GetAtt": ["TransactionUploadQueue", "Arn"] }, "Condition": { "ArnEquals": { "aws:SourceArn": { "Ref": "TransactionUploadTopic" } } } }] } } }, "TransactionUploadRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "ec2.amazonaws.com" ] }, "Action": [ "sts:AssumeRole" ] } ] }, "Path": "/", "Policies": [{ "PolicyName": "TransactionUploadPolicy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [{ "Sid": "1", "Effect": "Allow", "Action": [ "s3:Get*", "s3:ListBucket", "s3:Put*", "s3:*MultipartUpload*" ], "Resource": [{ "Fn::Join": ["", ["arn:aws:s3:::", { "Ref": "AppBucket" }, "/*"]] }, { "Fn::Join": ["", ["arn:aws:s3:::", { "Ref": "AppBucket" }]] }] }, { "Sid": "2", "Effect": "Allow", "Action": "sns:Publish", "Resource": { "Ref": "TransactionUploadTopic" } }, { "Sid": "3", "Effect": "Deny", "Action": [ "sns:*Permission*", "sns:*Delete*", "sns:*Remove*", "s3:*Policy*", "s3:*Delete*" ], "Resource": "*" }] } }] } } }, "Outputs": { "InstanceSecurityGroup": { "Value": {"Ref": "InstanceSecurityGroup"} }, "AppBucket": { "Value": { "Ref" : "AppBucket"} }, "TransactionUploadTopic": { "Value": { "Ref" : "TransactionUploadTopic" } }, "TransactionUploadQueue": { "Value": { "Ref" : "TransactionUploadQueue" } }, "TransactionUploadRoleArn": { "Value": { "Fn::GetAtt": ["TransactionUploadRole", "Arn"]} } } } ```
1
answers
0
votes
52
views
asked 3 months ago

An SNS message with a double quote in ANY attribute is filtered out. Is this a bug?

The documentation https://docs.aws.amazon.com/sns/latest/dg/sns-subscription-filter-policies.html says > When Amazon SNS evaluates message attributes against the subscription filter policy, it ignores message attributes that aren't specified in the policy. Through some experimentation I have determined that SNS messages with a double quote in one of their attribute values will always be filtered out for a subscription with a filter policy, even if the filter policy doesn't mention the attribute. It does NOT get filtered out if you put a backslash character before the double quote. I can't find any reference to this in the documentation so I don't know if it's expected behavior. It seems like a bug. Example: SNS subscription filter policy: ``` { "action": ["purchase"] } ``` Message Attributes (PASSES filter): * action - DataType: String, StringValue: purchase * metadata - DataType: String, StringValue: abc Message Attributes (DOES NOT PASS filter): * action - DataType: String, StringValue: purchase * metadata - DataType: String, StringValue: "abc Message Attributes (PASSES filter): * action - DataType: String, StringValue: purchase * metadata - DataType: String, StringValue: \"abc This problem occurred because we have a String type attribute with a JSON blob in the value. I eventually narrowed the problem down to just the presence of the double quote character. I have found a few examples of other people encountering this issue: * https://forums.aws.amazon.com/thread.jspa?threadID=300797 * https://forums.aws.amazon.com/thread.jspa?threadID=318176 * https://forums.aws.amazon.com/message.jspa?messageID=841824 Is this a bug?
1
answers
1
votes
71
views
asked 4 months ago

Simple Email Service (SES) notifications via Simple Notification Service (SNS) - JSON sent is different from documenation?

I have completed all the steps to configure Amazon SES and SNS to send email event notifications to a webhook. 1. [Created the configuration set](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-create-configuration-set.html) 2. [Added/confirmed the destination](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-add-event-destination.html) 3. [Added the configuration set header to emails sent via SMTP](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-send-email.html) I am receiving data. I've tested send, open, and click notifications thus far by placing a checkpoint on the listener and stepping through the process after sending, opening, and clicking a link in the email(s). However, the JSON data received is not like what the Amazon documentation states, as [listed here](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-contents.html) in the overview, and [listed here](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-examples.html) with examples. For example, this is what the documentation says a Send notification should look like: ``` { "eventType": "Send", "mail": { "timestamp": "2016-10-14T05:02:16.645Z", "source": "sender@example.com", "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com", "sendingAccountId": "123456789012", "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000", "destination": [ "recipient@example.com" ], "headersTruncated": false, "headers": [ { "name": "From", "value": "sender@example.com" }, { "name": "To", "value": "recipient@example.com" }, { "name": "Subject", "value": "Message sent from Amazon SES" }, { "name": "MIME-Version", "value": "1.0" }, { "name": "Content-Type", "value": "multipart/mixed; boundary=\"----=_Part_0_716996660.1476421336341\"" }, { "name": "X-SES-MESSAGE-TAGS", "value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2" } ], "commonHeaders": { "from": [ "sender@example.com" ], "to": [ "recipient@example.com" ], "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000", "subject": "Message sent from Amazon SES" }, "tags": { "ses:configuration-set": [ "ConfigSet" ], "ses:source-ip": [ "192.0.2.0" ], "ses:from-domain": [ "example.com" ], "ses:caller-identity": [ "ses_user" ], "myCustomTag1": [ "myCustomTagValue1" ], "myCustomTag2": [ "myCustomTagValue2" ] } }, "send": {} } ``` However, this is not what is being sent to my listener/webhook. For example, when a Send notification comes in, this is what is being sent (redacted): ``` { "Type": "Notification", "MessageId": "", "TopicArn": "", "Subject": "Amazon SES Email Event Notification", "Message": "{", ":": { "timestamp": "", "source": "", "sourceArn": "", "sendingAccountId": "", "messageId": "", "destination": [ "" ], "headersTruncated": false, "headers": [ { "name": "Received", "value": "" }, { "name": "X-SES-CONFIGURATION-SET", "value": "" }, { "name": "thread-index", "value": "" }, { "name": "Thread-Topic", "value": "" }, { "name": "From", "value": "" }, { "name": "To", "value": "" }, { "name": "Subject", "value": "" }, { "name": "Date", "value": "" }, { "name": "Message-ID", "value": "" }, { "name": "MIME-Version", "value": "1.0" }, { "name": "Content-Type", "value": "" }, { "name": "X-Mailer", "value": "" }, { "name": "Content-Class", "value": "" }, { "name": "Importance", "value": "" }, { "name": "Priority", "value": "" }, { "name": "X-MimeOLE", "value": "" } ], "commonHeaders": { "from": [], "date": "", "to": [], "messageId": "", "subject": "" }, "tags": { "ses:operation": [], "ses:configuration-set": [], "ses:source-ip": [], "ses:from-domain": [], "ses:caller-identity": [] } }, "send": {} } ``` The other notifications are similar, and nothing like the documentation, where the "eventType" is not included, and the "event" is always "notification". For example, here is what a "Click" notification includes: ``` { "Type": "Notification", "MessageId": "", "TopicArn": "", "Subject": "Amazon SES Email Event Notification", "Message": "{", ":": { "timestamp": "", "source": "", "sendingAccountId": "", "messageId": "", "destination": [], "headersTruncated": false, "headers": [ { "name": "", "value": "" }, { "name": "X-SES-CONFIGURATION-SET", "value": "" }, { "name": "thread-index", "value": "" }, { "name": "Thread-Topic", "value": "" }, { "name": "From", "value": "" }, { "name": "To", "value": "" }, { "name": "Subject", "value": "" }, { "name": "Date", "value": "" }, { "name": "Message-ID", "value": "" }, { "name": "MIME-Version", "value": "" }, { "name": "Content-Type", "value": "" }, { "name": "X-Mailer", "value": "" }, { "name": "Content-Class", "value": "" }, { "name": "Importance", "value": "" }, { "name": "Priority", "value": "" }, { "name": "X-MimeOLE", "value": "" } ], "commonHeaders": { "from": [], "date": "", "to": [], "messageId": "", "subject": "" }, "tags": { "ses:operation": [], "ses:configuration-set": [], "ses:source-ip": [], "ses:from-domain": [], "ses:caller-identity": [] } }, "click": { "timestamp": "", "ipAddress": "", "userAgent": "", "link": "", "linkTags": null } } ``` I could go down the road of looking for certain values in order to determine what type of event is being sent in, but I would have to generate every single event type (including bounce, spam, reject, etc) just to see what the JSON looks like in order to process it. Did I miss something in the configuration? If not, is there documentation on what the JSON data looks like for this "type" of setup?
0
answers
0
votes
12
views
asked 5 months ago

SES Open Events - Getting Duplicate events from cloudfront IPs

We have been having an issue where we receive multiple Open Events via SNS. These events happen withing a split second of each other, and all come from cloud watch ip addresses. This doesn't appear to happen for every recipient, but it loooks to be around 50%. Below are events we have received (with sensitive data removed) to give you an idea of what we're seeing. 1. Why are there multiples happening? 2. Why are they in such quick succession? 3. Why are they reporting cloudfront IP addresses? Additional Info - We are sending from a domain setup in cloudfront - WE only receive a single Sent and Delivered Event. - Click events can exhibit this behaviour as well Event 1 ``` {"eventType":"Open","mail":{"timestamp":"2022-01-31T21:00:01.769Z","source":"xxxxx","sendingAccountId":"xxxxx","messageId":"0108017eb1effb69-5ce6a9ca-e8f4-4d57-9aa8-1d6d55e89433-000000","destination":["xxxxx"],"headersTruncated":false,"headers":[{"name":"From","value":"xxxxx"},{"name":"Date","value":"Tue, 01 Feb 2022 08:00:01 +1100"},{"name":"Subject","value":"xxxxx"},{"name":"Message-Id","value":"<YNOLANVQYFU4.CDP4G8YK0B121@xxxxx>"},{"name":"To","value":"xxxxx"},{"name":"MIME-Version","value":"1.0"},{"name":"Content-Type","value":"multipart/mixed; boundary=\"=-bSeeSpdqGZ87P9P4desJPg==\""}],"commonHeaders":{"from":["xxxxx"],"date":"Tue, 01 Feb 2022 08:00:01 +1100","to":["xxxxxx"],"messageId":"0108017eb1effb69-5ce6a9ca-e8f4-4d57-9aa8-1d6d55e89433-000000","subject":"xxxxxx"},"tags":{"ses:operation":["SendRawEmail"],"ses:configuration-set":["xxxxxx"],"ses:source-ip":["203.55.35.200"],"ses:from-domain":["xxxxxx"],"ses:caller-identity":["xxxxx"]}},"open":{"timestamp":"2022-01-31T21:14:02.524Z","userAgent":"Mozilla/4.0 (compatible; ms-office; MSOffice 16)","ipAddress":"64.252.184.86"}} ``` Event 2 ``` {"eventType":"Open","mail":{"timestamp":"2022-01-31T21:00:01.769Z","source":"xxxxx,"sendingAccountId":"xxxxx","messageId":"0108017eb1effb69-5ce6a9ca-e8f4-4d57-9aa8-1d6d55e89433-000000","destination":["xxxxx"],"headersTruncated":false,"headers":[{"name":"From","value":"xxxxx"},{"name":"Date","value":"Tue, 01 Feb 2022 08:00:01 +1100"},{"name":"Subject","value":"xxxxx"},{"name":"Message-Id","value":"<YNOLANVQYFU4.CDP4G8YK0B121@xxxxxx>"},{"name":"To","value":"xxxxxx"},{"name":"MIME-Version","value":"1.0"},{"name":"Content-Type","value":"multipart/mixed; boundary=\"=-bSeeSpdqGZ87P9P4desJPg==\""}],"commonHeaders":{"from":["xxxxxx"],"date":"Tue, 01 Feb 2022 08:00:01 +1100","to":["xxxxxx"],"messageId":"0108017eb1effb69-5ce6a9ca-e8f4-4d57-9aa8-1d6d55e89433-000000","subject":"xxxxx"},"tags":{"ses:operation":["SendRawEmail"],"ses:configuration-set":["xxxxx],"ses:source-ip":["203.55.35.200"],"ses:from-domain":["xxxxx"],"ses:caller-identity":["xxxxx"]}},"open":{"timestamp":"2022-01-31T21:14:02.601Z","userAgent":"Mozilla/4.0 (compatible; ms-office; MSOffice 16)","ipAddress":"64.252.184.77"}} ```~~~~ Event 3 Much the same, but with timestamp: 2022-01-31T21:14:05.990Z ipaddress: 64.252.184.74 useragent: Mozilla/4.0 (compatible; ms-office; MSOffice rmj)
0
answers
0
votes
6
views
asked 5 months ago
  • 1
  • 90 / page