Skip to content

Commit

Permalink
module cloudwatch_metric_alarm support DatapointsToAlarm config
Browse files Browse the repository at this point in the history
  • Loading branch information
owan committed Jul 17, 2024
1 parent 3a0dc86 commit 2c10f81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/modules/cloudwatch_metric_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2c10f81

Please sign in to comment.