amazon-sns

How to subscribe an SNS topic of one account by SQS of another account using boto3?

爷,独闯天下 提交于 2019-12-04 07:05:13
I'm trying to create an SNS topic in one account and attach it to Config Rules. I have 3 such accounts and want to create SNS topic in each of the account. Now i want to subscribe all of the 3 topics of 3 different accounts by SQS of the fourth account. I'm able to do it manually. Can somebody please tell me how it can be done via boto3. Thanks in Advance. In order to subscribe a SNS topic present in Account A by an SQS present in Account B using boto3, following is the procedure. In Account A, create SNS topic and add the proper permission. For example, import boto3 sns_client = boto3.clien(

Can you send SNS push notification from lambda function in Amazon AWS?

泪湿孤枕 提交于 2019-12-04 05:35:00
I am developing an application with Amazon AWS and what I am trying to achieve is to attach a lambda function to DynamoDB table, so after a new row is added ,the lambda function is triggered. In the above mentioned lambda function I want to add the functionality to send a push notification with Amazon SNS service, but I could not find any information in their documentation if that is possible and if it is, what exactly needs to be done to get it working? What I found in their documentation is that you can attach lambda function trigger to a SNS topic, which means that after a notification is

CloudWatch alarm to SNS in different region

扶醉桌前 提交于 2019-12-04 05:32:41
I'm trying to notify an SNS topic from a CloudWatch alarm that's in a different region. The reason is that I want SMS alerting, which isn't available in the region where my services are. If I enter the ARN of the subscription and save the changes in the console, I get "There was an error saving the alarm. Please try again." Trying again does not help. Using a topic in the local region does work, but that's not what I need. Is there a way to notify a topic in a different region? If not, is there another easy way I can achieve my goal? Didn't find any docs that explicitly say this can't be done

AWS SNS publishing to a subscribed Lambda function logs null fields

余生长醉 提交于 2019-12-04 04:51:57
Tried to post this to the AWS Forums, but it seems my account is "not yet ready", whatever that means. I've setup an AWS Lambda function (written in Java) that accepts a POJO in order to allow for automatic deserialization of JSON. The test JSON I am using is below and represents the JSON string that will be sent from the ultimate source of the message once everything is up and running. {"sender":"Joe", "id":1, "event":"started", "ticks":2, "time":"20150623T214256Z", "version":"1.0"} This worked perfectly when I tested it by publishing to it from the Lambda "test" console. I'm now trying to

Sending attachment using AWS SNS(Simple Notification Service)

陌路散爱 提交于 2019-12-04 03:32:05
I am using AWS SNS for sending alert emails. Now the email content is really long therefore I wish to send it as a file attachment rather than sending it as a email content. Can this be done using SNS ? No, it can't. The SNS FAQ does not come out and explain this explicitly, but it can be inferred from several statements: Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text. The ”Email” transport is meant for end-users/consumers and notifications are regular, text-based messages which are easily readable. In addition, since you do not have access

How do I check whether a mobile device has already been registered

≯℡__Kan透↙ 提交于 2019-12-04 03:15:47
I'm using the Amazon AWS Ruby SDK for Amazon SNS but I'm having some trouble with devices already being registered. Sometimes when a device gets registered again I get an error like AWS::SNS::Errors::InvalidParameter Invalid parameter: Token Reason: Endpoint arn:aws:sns:us-east-1:**** already exists with the same Token, but different attributes. . How do I check whether an endpoint already exists and more importantly, how do I get the endpoint for a given token? Credit to BvdBijl's idea, I made an extension method to delete the existing one if found and then add it. using System; using System

Timeout when publishing from AWS Lambda to SNS

Deadly 提交于 2019-12-04 02:45:41
I'm trying to publish some data to SNS from a Lambda function call, but it doesn't seem to be working. My function code is - public class Handler implements RequestHandler<DynamodbEvent, Void> { private static final String SNS_TOPIC_ARN = "arn:aws:sns:us-west-2:account_number:function_name"; @Override public Void handleRequest(DynamodbEvent dynamodbEvent, Context context) { LambdaLogger logger = context.getLogger(); AmazonSNSClient snsClient = new AmazonSNSClient(new DefaultAWSCredentialsProviderChain()); snsClient.setRegion(Region.getRegion(Regions.US_WEST_2)); for (DynamodbStreamRecord

How to confirm the subscription of Amazon SNS without having the endpoint token?

旧街凉风 提交于 2019-12-04 00:31:40
In my JAVA application, I'm using Amazon SNS to send emails to customer; Once I subscribe one customer(email id) into my SNS Topic; It is asking the customer to confirm the subscription to receive the emails; Is there any way to confirm the subscription in our application itself(without cusstomer's help)? No, it is not possible. The entire point of the confirmation step is to force the end user to confirm the subscription so that SNS cannot be used as a spamming mechanism. If SNS allowed the application developer to confirm subscriptions without access to the endpoint token, then you could

AWS push notification service integration error

十年热恋 提交于 2019-12-03 23:01:22
I am trying to integrate Amazon Push Notifications to my iPhone app. I did follow the tutorial provided here correctly. I am getting this error when creating the Platform EndPoint. (Seems a permission issue with identity pool???) CognitoIdentityCredentials is not authorized to perform: SNS:CreatePlatformEndpoint Full message: Error: Error Domain=com.amazonaws.AWSSNSErrorDomain Code=4 "The operation couldn’t be completed. (com.amazonaws.AWSSNSErrorDomain error 4.)" UserInfo=0x165dcef0 {Type=Sender, Message=User: arn:aws:sts::290442422498:assumed-role/Cognito_Laugh_DevUnauth_Role

App connected to FCM not receiving notification from AWS SNS

↘锁芯ラ 提交于 2019-12-03 20:24:40
I've connected an Android app to Google Firebase Cloud Messaging service (FCM) following this guide , and I've followed this answer to setup the connection between FCM & AWS SNS . I could successfully receive message sent from FCM console but not from AWS SNS console . The message delivery status logged on AWS showed SUCCESS for every message I've sent while no notification was shown on my device. Is there a way to check what's going on? The problem here is that AWS SNS sends what Google call data messages. With FCM you can send two types of messages - notifications and data. Notifications get