AWS CDK sns Delivery status logging - amazon-sns

I have a scenario where I publish a message in a SNS topic and this message then is sent to SQS queue. What I want is to have logs in SNS everytime a message is sent to a subscriber (like my sqs queue). SNS being a passive component of AWS, logs are not generated automatically and must be set up through the feature "Delivery status logging". I have accomplished the set up through the AWS console but I would like to do it through the AWS CDK. I did not find anything in the documentation and either in examples through the web. Anyone already did that ?
Regards,

I am afraid it can be done currently only via AWS SDK or management console: https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html
To configure topic attributes for message delivery status, you can use the AWS Management Console, AWS software development kits (SDKs), or query API.
I see no option to set it via CloudFormation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic.html

Related

EventBridge messages not published to SNS

I configured AWS EventBridge to post events to an SNS target. When an event is received, the SNS target is never triggered and none of the SNS subscribers get the event.
If I add other targets to EventBridge it works (eg, Lambda) but the SNS does not. Adding a dead-letter queue to SQS show there's a permissions issue:
However, changing the Access Policy of SNS does not work.
If encryption is enabled for SNS, disabling it is not the solution. Rather give events service the required access policy to encrypted SNS topic.
More details on following link here:
https://aws.amazon.com/premiumsupport/knowledge-center/cloudwatch-receive-sns-for-alarm-trigger/#:~:text=If%20the%20SNS%20topic%20must,messages%20to%20encrypted%20SNS%20topics.
Replace cloudwatch.amazonaws.com to events.amazonaws.com
Update:
It seems encryption is not supported if using the default AWS Key Management Service (KMS). It can be configured using customer managed keys as explained in this other answer.
Old answer:
The problem seems to be a configuration issue or even a bug in AWS. If the SNS Topic has Encryption At-Rest enabled, then it fails.
The solution is to disable Encryption under the SNS Topic settings:
This issue was with using the AWS-managed keys(aws/sns).
Changing to Customer managed keys worked for me.
You can also add multiple targets to check if logs are generating. The easiest would be log-group.

How to set up email notification for identify the last commit user and send codepipline status

I am working on AWS Codepipeline, How to set up e-mail notifications for developer did last commit and build was failed. Now identify the user and send automatic email for the developer along with manager. Can anyone please help on this
Thanks in Advance
You can use notification rules to notify users of important changes, such as when a pipeline starts execution. Notification rules specify both the events and the Amazon SNS topic that is used to send notifications. On the SNS topic, a subscription could be a User/Manager email address. Details here: [0]
Currently the notification message that is sent in case of, for example, pipeline success, does not include the Commit id or the Committer information [1].
As a work-around I suggest to implement additional stages within the pipeline that would Invoke a Lambda Function. The Lambda Function can then be programmed to publish the detailed event message [2] to the SNS using AWS SDKs. Detailed instructions for this set-up are documented at [3].
References:
[0] https://docs.aws.amazon.com/codebuild/latest/userguide/notification-rule-create.html
[1] https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#codepipeline_event_type
[2] Example JSON Event - https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
[3] Invoke an AWS Lambda Function in a Pipeline in AWS CodePipeline - https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html

can azure service bus (for a topic) send notification to a rest end point (POST)

I need to azure service bus to notify an end point (Rest - POST) whenever a message comes to a particular topic.
In AWS, it is done this way
AWS llink
What is the equivalent in Azure.
Note: I dont want to write code that will receive the message and then call the end point.
Azure Service Bus is a messaging service, not a Notifications service. As such, it deals solely with messaging, and doesn't create notifications for you.
AWS combines SQS (Simple Queuing Service) with SNS (Simple Notification Service) behind the scenes to allow you the functionality you're describing. This is to allow SQS to have a behaviour of events. Azure Service Bus has a native support for Topics and Subscriptions (if that's what you're looking for). I.e. rather than just sending messages to a queue, the message is sent to a topic and appropriate subscriber(s) will get it.
So the short answer to this question in case you don't want to receive the message and trigger a notification is "no".
Saying that, if you're OK with "serverless" functions (similar to AWS Lambdas), you could use Azure Functions to achieve this goal.
Looks like finally azure released Azure Event Grid which kinds of does this out of the box.. very similar to AWS SQS + AWS SNS combo
https://learn.microsoft.com/en-us/azure/event-grid/overview

multiple endpoints with same token in AWS SNS

I am using AWS SNS for sending push notifications and I have used this article for the implementation http://mobile.awsblog.com/post/Tx223MJB0XKV9RU/Mobile-token-management-with-Amazon-SNS
I am storing the token and the endpoints in the server for sending the push notifications, but the problem is with GCM when the reg_id gets changed and pervious reg_id is still active then the aws update the pervious endpoint with latest token, due to which I have got two endpoints with same reg_id and when I am sending the push notification then it is getting delivered twice.
I have searched everywhere but I am not able to find the solution, how do I update my server DB to delete the older endpoint.

Worklight Unified Push Notification - JMS Queue Pulling Architecture

For reference check the below URL.
https://www.ibm.com/developerworks/community/blogs/worklight/entry/worklight_push_notification_possible_architectures?lang=en
I have hosted my Worklight Server in IBM softlayer. Is SoftLayer Message Queue is a JMS 2.0 API based message queue or different. If its a JMS based message queue, it possible to use that for IBM Worklight Unified Push Notification.
It is not clear from your question if you are asking whether this is possible, or that you have done so and ask for opinions... Edit the question and clarify.
If the SoftLayer Message Queue supports JMS, then it will probably work.
If not, then you should probably go for the second architecture from the linked blog post.
SO a few clarification here:
1 Of this is hosted on SoftLayer --- can u add more details... SL has may products include typical IaaS type offerings and services and API include Message queuing an Object storage.
2. Softlayer also provides server/storage/network etc which are IaaS type offerings.
assuming you installed WL on a instance and has access to SL networks etc to the other services hosted on SL, if connectivity exists and you can create JMS adapters, this seems possible.
Now:
1. The IBM Worklight JMS adapter can be used to send and receive messages from a JMS-enabled messaging provider. It can be used to send and receive the headers and body of the messages.
2. To start receiving push notifications, an application must first subscribe to a push notification event source. The event source is a push notification channel to which mobile applications can register. An event source is defined within a Worklight adapter. The device user must approve the push notification subscription.
so technically you should be able to use JMS compliant message queue as an even source.
N

Resources