-
Notifications
You must be signed in to change notification settings - Fork 421
feat(data_classes): Add CloudWatchAlarmEvent data class #3868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(data_classes): Add CloudWatchAlarmEvent data class #3868
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
@rubenfonseca I'm done with the changes. I've tried running |
Looking at this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @par6n! Thank you for sending this OR! This is great work.
I made some comments to improve the customer experience and hope we can address them soon and merge this PR!
aws_lambda_powertools/utilities/data_classes/cloud_watch_alarm_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/cloud_watch_alarm_event.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/data_classes/cloud_watch_alarm_event.py
Outdated
Show resolved
Hide resolved
…atchAlarmState This will allow the customers to easily access the raw 'reasonData' field, as well as accessing parsed data using the new property.
…e` in CloudWatchAlarmState
…ontains the alarm data
@leandrodamascena Thanks for the excellent comments! I'm not a Python-savvy, and I've already learned a few things working on this. |
Ohhh really? No one can say that you haven't written code in Python for a long time, the code is very clean and well documented. I'm checking the documentation and I see some fields that are missing, for example when you have a composite alarm you have additional fields, for example: 'previousState': {
'value': 'ALARM',
'reason': 'arn:aws:cloudwatch:us-east-1:111122223333:alarm:CompositeDemo.FirstChild transitioned to ALARM at Friday 04 August, 2023 12:54:46 UTC',
'reasonData': '{"triggeringAlarms":[{"arn":"arn:aws:cloudwatch:us-east-1:111122223333:alarm:CompositeDemo.FirstChild","state":{"value":"ALARM","timestamp":"2023-08-04T12:54:46.138+0000"}}]}',
'timestamp': '2023-08-04T12:54:46.138+0000',
'actionsSuppressedBy': 'WaitPeriod',
'actionsSuppressedReason': 'Actions suppressed by WaitPeriod'
}, It's very late here and I'm wrapping up the day. Please give me until tomorrow to push some commits that address certain issues. I will explain the details of the fixes that I address. Please let me know if you have any other questions in the meantime. Thanks again. |
…e file for CW alarm state change action
…-data-class' into feat/add-cloud-watch-alarm-event-data-class
…ed_reason` properties to CloudWatchAlarmState
|
Hello @par6n! I pushed a commit with a fix for a few small things and here is the list of what I changed: 1 - I removed the Thank you for your outstanding work on this task. Before merging, I'm sending this PR to @rubenfonseca for review. If you have any questions or need clarification, please feel free to reach out to me. |
@leandrodamascena I checked out your changes, and it all looks good to me. Excellent work over there! If there's anything I could do further for this PR, please let me know! |
Reviewing now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APPROVED!! @par6n
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #3848
Summary
AWS has recently introduced AWS Lambda as an alarm state change action (link to the news entry). This pull request facilitates reading the event that a CloudWatch Alarm sends to a Lambda function.
Changes
CloudWatchAlarmEvent
, along with its satellite data classes and enums.Pending items:
User experience
You will be able to deserialize the CloudWatch Alarm state change event. Docstrings are added for fields.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.