Skip to content

Commit

Permalink
Don't consider prop 'StateTransitionedTimestamp' in change detection (#…
Browse files Browse the repository at this point in the history
…1440)

Don't consider prop 'StateTransitionedTimestamp' in change detection

SUMMARY

Remove property 'StateTransitionedTimestamp' from the list of props when determining if an alarm has changed and needs to be create/updated.

Fixes #1439
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
cloudwatch-metric-alarm
ADDITIONAL INFORMATION
See issue #1439 for additional details.

Reviewed-by: Mark Chappell
Reviewed-by: Alina Buzachis
  • Loading branch information
davidovp authored Mar 28, 2023
1 parent 419b2cc commit 8acb076
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- cloudwatch_metric_alarm - Don't consider ``StateTransitionedTimestamp`` in change detection. (https://github.com/ansible-collections/amazon.aws/pull/1440).
2 changes: 2 additions & 0 deletions plugins/modules/cloudwatch_metric_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ def create_metric_alarm(connection, module, params):
if 'TreatMissingData' not in alarm.keys():
alarm['TreatMissingData'] = 'missing'

# Exclude certain props from change detection
for key in ['ActionsEnabled', 'StateValue', 'StateReason',
'StateReasonData', 'StateUpdatedTimestamp',
'StateTransitionedTimestamp',
'AlarmArn', 'AlarmConfigurationUpdatedTimestamp', 'Metrics']:
alarm.pop(key, None)
if alarm != params:
Expand Down

0 comments on commit 8acb076

Please sign in to comment.