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

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

Related

AWS CDK sns Delivery status logging

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

How to Send and receive Scheduled notifications FCM Flutter [duplicate]

I have working with FCM console to send push notification and it has an option to schedule the delivery date.
But in the references, this API is not documented as an option. I need to know if its possible to push a notification with predefined delivery date through a POST request.
If you're looking for a public API of FCM for a scheduled push or a payload parameter where you can set the push date, unfortunately, there's nothing like it as of the moment.
You must implement your own App Server and implement the scheduled push yourself (also mentioned it here).
As an alternative to ALs excellent answer: you could:
send a data message with FCM straight away,
in that message include a field with when the message is to be displayed,
them in your application code show the message when it is due.
This has the added advantage that the message can be delivered when the user has a connection, and then displayed when they don't have a network connection.
Of course this only works if you can determine the exact message before it is displayed. If the contents of the message can only be known right before it is displayed, you will need to implement your own mechanism to schedule deliver as AL said in his answer.

How to send a push notification from the Firebase console to a specific GCM/FCM device token ID

In Urban Airship, when I am composing a notification, I can target specific users by searching for a Urban Airship channel_id (device ID):
I sent from Urban Airship the push notification that I am showing above, and I received it successfully. Now I want to do the same thing, send a push notification to a specific device, but now using the Firebase console. The problem is that in Firebase, in the step where I need to specify the target, it only allows me to choose User segment or topic. I was expecting to see a third option: Target specific users (for sending notifications to one or many specific GCM/FCM device token IDs. So my alternative is to add a GCM/FCM device token ID to a topic and then send the push notification to that topic, which is something that I have successfully done before. Nonetheless, that would be a workaround and not the way I would prefer to do this. Is it possible to send push notifications to specific users (by defining the target GCM/FCM device token IDs) from the Firebase console? Thank you.
UPDATE 1: See how the Firebase console (https://console.firebase.google.com/) only shows User segment and Topic as the Target:
First Step:
Second Step:
Third Step:
By design, the notification feature in the console is for sending out broadcast-type events. Sending user-specific alerts would be more of a programmatic operation done through the API.
For sending test messages, there is a console tool for this, explained here.
Note that it is possible to send a notification to one device by subscribing a device to any topic and sending the notification to that topic in the console (keep in mind topics are public and you can't prevent users from signing up to them; fine for testing most likely).
Another alternative is to send a message via HTTP or curl. Perhaps the best resource for this is the quickstart/messaging example.

SNS getEndpointAttributes Returns Old Data After EventEndpointUpdated Event

When attaching a topic to a SNS application's "Endpoint updated" configurable topic I'm experiencing some unexpected behavior. Per AWS's documentation on SNS Application Events, I should receive an event on my configured topic when a platform endpoint has been updated to disabled or it's token changed.
In my case I have a lambda function subscribed to this topic that then retrieves the platform endpoint's attributes via a call to AWS's javascript sdk SNS.getEndpointAttributes so that I can check what attribute have changed to either delete the endpoint or update the associated token in my persistent storage. This call however is returning the endpoints as Enabled = true which then prevents me from taking the corrective actions. However if I look in the AWS SNS console I can see the endpoint has been disabled as Enabled = false.
Have others experienced similar inconsistencies and if so what's the best practice to get around them? Thanks for any input!
I was also facing the similar problem when amazon notified me sns application events via http. To work around this problem i actually delayed the execution of code that sync these endpoint updates with my database. To achieve this i scheduled a job for my background queue worker and delayed its execution after 30 seconds from the time amazon notified via http. I don't know whether it is a best practice or not but it is working in my scenario.

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

Resources