From 2c10f819a54b437f2f8c33013a8a7d167a711d6b Mon Sep 17 00:00:00 2001 From: owan Date: Wed, 17 Jul 2024 09:33:17 +0800 Subject: [PATCH] module cloudwatch_metric_alarm support DatapointsToAlarm config --- plugins/modules/cloudwatch_metric_alarm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/modules/cloudwatch_metric_alarm.py b/plugins/modules/cloudwatch_metric_alarm.py index ff82a9b770a..126cafe34a1 100644 --- a/plugins/modules/cloudwatch_metric_alarm.py +++ b/plugins/modules/cloudwatch_metric_alarm.py @@ -161,6 +161,11 @@ type: str choices: ['ignore', 'evaluate'] version_added: 9.0.0 + datapoints_to_alarm: + description: + - The number of data points that must be breaching to trigger the alarm. + required: false + type: int evaluation_periods: description: - The number of times in which the metric is evaluated before final calculation. @@ -510,6 +515,7 @@ def create_metric_alarm(connection, module, params): dimensions=result.get("Dimensions"), extended_statistic=result.get("ExtendedStatistic"), evaluate_low_sample_count_percentile=result.get("EvaluateLowSampleCountPercentile"), + datapoints_to_alarm=result.get("DatapointsToAlarm"), evaluation_periods=result.get("EvaluationPeriods"), insufficient_data_actions=result.get("InsufficientDataActions"), last_updated=result.get("AlarmConfigurationUpdatedTimestamp"), @@ -592,6 +598,7 @@ def main(): ], ), evaluate_low_sample_count_percentile=dict(type="str", choices=["ignore", "evaluate"]), + datapoints_to_alarm=dict(type="int"), evaluation_periods=dict(type="int"), extended_statistic=dict(type="str"), description=dict(type="str"), @@ -634,6 +641,7 @@ def main(): params["Threshold"] = module.params.get("threshold") params["Period"] = module.params.get("period") params["EvaluateLowSampleCountPercentile"] = module.params.get("evaluate_low_sample_count_percentile") + params["DatapointsToAlarm"] = module.params.get("datapoints_to_alarm") params["EvaluationPeriods"] = module.params.get("evaluation_periods") if module.params.get("unit"): params["Unit"] = module.params.get("unit")