AWS EventBridge handle UpdateThingShadow event - amazon-web-services

Is it possible for AWS EventBridge to track UpdateThingShadow type of event and create a rule for those? How might an event pattern for such an update look like, and is the AWS service that we listen to AWS IOT Core, AWS CloudTrail or AWS CloudWatch?
The use case is that I do not want to expose the Device shadow directly, but have a table that reflects the state. Updating the table would trigger a custom EventBridge event that updates the table, while updating the DeviceShadow directly should trigger an AWS event that can hopefully be caught in the default AWS EventBridge. The question is what service triggers the event I might want to catch, and what EventPattern would that be.
Based on the IOT Core documentation, there is no mention of device shadow update events being triggered by the IOT Core service.
There is though, mention of monitoring UpdateThingShadow in CloudWatch. Does that mean that my EventBridge should listen to events coming in from Cloudwatch of type UpdateThingShadow?

Related

How to filter CloudWatch event by event id

How to filter cloudwatch events based on the event id eg: DMS-EVENT-0078, DMS-EVENT-0082
we are looking at the cloudwatch event messages but not able to see the event-id
we are planning to use a lambda to filter only few event-id and create alarms accordingly
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html
Thank you
your Support is Much Appreciated
The AWS Database Migration Service notification events are separate from CloudWatch (CW) Events. You can't use them from CW Events rules.
CW Events support only AWS API Call via CloudTrail events for DMS.
Thus you can setup SNS for the DMS notifications, which in turn will invoke your lambda function. The lambda function can filter or process the events of interest to you.

Difference between S3 Events and Cloudwatch Events

I see this question has been asked few times but has not been answered yet. Making another attempt.
What is the basic difference between an S3 event and Cloudwatch events ?
Is one is preferred over the other ?
Appreciate an answer.
Thanks !
S3 Event Notifications are for events that are specific to S3 buckets. S3 Events Notifications can publish events for
New object created
Object removal
Restore object
Reduced Redundancy Storage (RRS) object lost events
Replication events
And it can send notifications to:
SNS topics
SQS queues
Lambda functions
CloudWatch Events, and the associated (preferred, actually) service, Amazon EventBridge, are much broader, and apply to the entire AWS platform. CloudWatch and EventBridge use the same underlying CloudWatch Events API, but EventBridge has more features.
You can use CloudWatch Events/EventBridge to react to any event published by AWS CloudTrail as well as from a very long list of integrated AWS services. These events can also be published on a schedule using a cron-like schedule expression syntax. It can send notifications to more targets as well, including Amazon EC2, Kinesis data streams, ECS tasks, Systems Manager, and much more.
Generally, it's preferable to use EventBridge for anything other than S3. Since EventBridge shares the same underlying API as CloudWatch Events, any change you make to either one will show up in the other. You should use S3 Events for any of the events listed above (see the docs for up an to date list of events).

Is there a scheduling service in AWS?

I need something like SQS that would call my api on schedule. Also I need to be able to create new "schedules"
AWS Cloudwatch events is what you are looking for:
Events—An event indicates a change in your AWS environment. AWS resources can generate events when their state changes. For example, Amazon EC2 generates an event when the state of an EC2 instance changes from pending to running, and Amazon EC2 Auto Scaling generates events when it launches or terminates instances. AWS CloudTrail publishes events when you make API calls. You can generate custom application-level events and publish them to CloudWatch Events. You can also set up scheduled events that are generated on a periodic basis. For a list of services that generate events, and sample events from each service, see CloudWatch Events Event Examples From Supported Services.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html

Count AWS IoT successfull connection

I want to count number of successful IoT connection and messages at a time , based upon that I want to apply a notification if it increases by some threshold.
I could not see any cloudwatch matrices/event for the same.
Please guide
You have a couple options. You can create a topic rule that listens on lifecycle topics. The rule could push a custom metric into AWS Cloudwatch or invoke a lambda that has more complex logic.
Another option would be to turn on the IOT logs, and setup a Lambda subscription to the IoT log group. The Lambda function could then push a custom metric into AWS CloudWatch.

AWS - is there a way to receive events asynchronously without the lambda

I have a general AWS question. I have started using AWS sdk, but looks like if I want to receive events asynchronously from AWS(ex: cloudwatch events), lambda functions is the only way. I want to write a simple application that registers a callback to AWS for events, but i couldn't find a way to do that till now, since i don't want to use lambda, i have been polling from my application. Please, let me know if polling is the only option or if there is a better way to resolve it without polling.
From the documentation:
You can configure the following AWS services as targets for CloudWatch Events:
Amazon EC2 instances
AWS Lambda functions
Streams in Amazon Kinesis Streams
Delivery streams in Amazon Kinesis Firehose
Amazon ECS tasks
SSM Run Command
SSM Automation
Step Functions state machines
Pipelines in AWS CodePipeline
Amazon Inspector assessment templates
Amazon SNS topics
Amazon SQS queues
Built-in targets
The default event bus of another AWS account
That's a lot more than just Lambda, so I'm not sure why you state in your question that Lambda is the only option. The options of Amazon EC2 instances and Amazon SNS topics both provide a method for Amazon to "push" the events to your services, instead of requiring your services to poll.
With cloudwatch events, you can set rules and trigger a number of different targets, including SQS queues which you can poll from your EC2 Instances.
Lambda is certainly a popular endpoint, but based on the docs, there are other targets you can send the events to
Already above answers might also be helpful, but one of the possible options to address your problem could be one of this as well.
You can make use of AWS SNS service to subscribe for the events on AWS resources. And the SNS can publish the events to your application end point. Which is nothing but pub/sub model.
Refer this link http://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html
The end-point could be your http or https based application.