Sending notifications to Amazon SNS on AWS DMS task progress - node.js

Is it possible to pull AWS DMS replication task percentage progress and use that to create an AWS Lambda function for sending notifications to Amazon SNS for let's say, every 10% completion? I can't find any metrics/event categories anywhere in relation to this while I was browsing. Thanks.

You don't need a lambda here. You can monitor the progress using CloudWatch then set up an SNS notification.
monitoring: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Monitoring.html
sns for cloudwatch: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/US_SetupSNS.html

Related

How do I read real time AWS Lambda logs using on-prem Python script?

I do not want to wait for 14 seconds to read CloudWatch Lambda logs.
Is there any way to read them in realtime in invoking shell on premises (outside VPC)?
Invoke async
result = lam.invoke(
InvocationType='Event',
FunctionName='my-lambda-func',
Payload=json.dumps(dict(test='test'))
)
Lambda writes logs to a service in question.
Loop/wait for real-time results in the same on separate shell.
A common way to use async invocation is to have your lambda publish your results to SQS queue or SNS topic. This way you can pull SQS queue on premise for results, or setup http endpoint subscription which will be automatically invoked by SNS when it gets a message from the lambda.
If you only want to focus on CloudWatch logs, then you can setup subscription filter on the logs for real-time processing of the incoming log events from lambda. Depending on your exact setup, you can use Kinesis, firehose or other lambda to get the log messages.

is it not possible to schedule aws-sns?

I am developing IOS and node.js application. And I want to use the push-notifications service. Finally, I decided to use Amazon's sns service.
And I want to send a push service to all registered devices at a specific time, one at a time. I do not know if Amazon's sns service can do it. Is this possible? If not, would I be better off using Firebases?
This can be done using Amazon CloudWatch Events. CloudWatch Events can invoke a SNS topic on a schedule that is user defined.

Aws s3 event don't support multiple events for same bucket

i want on s3 put bucket should emit multiple events i.e lambda,sqs & sns services. i tried single service to emit on bucket put. but now i want multiple service to be emitted by bucket on put. to perform different task.
how can i achieve this, i googled it but no use.
any help will be appreciated.
thank you in advance.
Your best bet can be to use something like Fanout scenario.
Create a topic using SNS and your bucket can publish a message to this topic on put Event.
Lambda and SQS can subscribe to this SNS topic. Whenever topic gets message, it will be received by all subscribers. Lambda will be invoked and queue will receive message, along with other subscriber(s).
SQS And SNS

Is it possible to an SNS Topic indefinitely?

I'm interested in publishing SES analytics data to SNS and publishing the SNS topic to somewhere (S3?) to store the data permanently.
Our control flow is as follows:
Create SES config set
Create SNS topic
Set config set destination to SNS topic
publish topic to s3?
The SNS subscribe() function says after confirming the subscription, it will last for 3 days. I'd like to make it last indefinitely so we can gather email analytics longer than 3 days.
If this is a reasonable approach, how would someone remove that expiration?
If this is the wrong approach, how should I approach storing SES analytics data permanently?
Thank you!
Going through SNS is too much round trip.
SES (Events) --> Firehose --> (S3 / Redshift / Elastisearch)
You can configure SES to send analytics data to Kinesis Firehose. You can configure Kinesis Firehose to deliver to S3 or Redshift or Elastisearch, depending upon your needs.
SES Events to Firehose:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/event-publishing-retrieving-firehose-contents.html
Event Data Transformation with Lambda:
With an intermediate Data transformation with Lambda you can manipulate the data before sending it to the desired destination.
http://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html
Hope it helps.

Designing SNS receiver in python script

Hi I am new to Python as well as AWS SNS services.
I want to develop a Python utility which would perform a role of subscriber as well as publisher to automate some simulations.
I am stuck where I need to design endpoint which would act as a SNS message receiver.
Could you guys please guide me on this topic.
AWS Lambda is a nice service for such scenarios and also it is quite cheap so will keep your AWS bills low.
You need publisher and subscriber for SNS in python so use AWS Lambda which will give you a nice connectivity with AWS SNS and there are few samples for subscribers which will help you in configuring the same.
So now your events get into AWS SNS and through subscription of lambda you can invoke Lambda function and take the action accordingly.
Event ---> SNS ---> Lambda Subscriber ---> Python Functions
Here is a nice reference for the same.
For publisher, you can use scheduled Lambda Function which will keep on pooling for some event to occur and then depending upon event you can send the notification to same SNS endpoint or different.
Event <--(Pooling)- Lambda Publisher(Cron Based) --(Event Occurred)-> SNS
Here is the AWS Tutorial for the same.
I hope this helps.
PS: Just keep in mind that maximum runtime for any Lambda function should not exceed certain limit which is 5 mins currently.

Resources