Skip to content

[Enhancement]: some of aws_cloudwatch_metric_alarm items are optional under certain circumstances  #36233

@abdallamourad

Description

@abdallamourad

Description

some of aws_cloudwatch_metric_alarm items are optional under certain circumstances, for example when defining an alarm as follows:

resource "aws_cloudwatch_metric_alarm" "cloudwatch_metric_alarm" {
  alarm_name                = "AlarmName"
  alarm_description         = "AlarmDescription"
  alarm_actions             = "AlarmAction"
  insufficient_data_actions = ""
  ok_actions                = "OKActions"
  comparison_operator       = "GreaterThanThreshold"
  threshold                 = 0
  evaluation_periods        = 1
  period                    = 60
}

I get these errors MetricName must not be blank and One of statisticorextended_statistic must be set for a cloudwatch metric alarm

These fields metric_name - statistic - extended_statistic are marked optional in the documentations. Is there a way to point out the conditions in which these fields are required

Affected Resource(s) and/or Data Source(s)

aws_v5.39.1

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationIntroduces or discusses updates to documentation.enhancementRequests to existing resources that expand the functionality or scope.service/cloudwatchIssues and PRs that pertain to the cloudwatch service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions