Skip to content
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

awscc_applicationsignals_service_level_objective does not appear to respect set values #2191

Open
connor-philip-ci opened this issue Feb 6, 2025 · 1 comment

Comments

@connor-philip-ci
Copy link

connor-philip-ci commented Feb 6, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_applicationsignals_service_level_objective" "example" {
  name        = "example"
  description = "example"

  goal = {
    attainment_goal   = 99.9
    warning_threshold = 99.0
    interval = {
      rolling_interval = {
        duration      = 30
        duration_unit = "DAY"
        start_time    = 1738853749
      }
    }
  }
  sli = {
    comparison_operator = "GreaterThan"
    metric_threshold    = 0

    sli_metric = {
      metric_data_queries = [
        {
          id = "event_count"
          account_id = var.account_id
          return_data = false   # <----- This value doesn't seem to be respected, set to true in console

          metric_stat = {
            period = 300  # <----- This value doesn't seem to be respected, set to 1 minute in console
            stat   = "Sum"

            metric = {
              namespace   = "AWS/Logs"
              metric_name = "IncomingLogEvents"
              dimensions = [
                {
                  name  = "LogGroupName"
                  value = "example-log-group"
                }
              ]
            }
          }
        },
        {
          id = "event_count_filled"
          account_id = var.account_id
          return_data = true # <----- Set to true as expected
          expression = "SUM(FILL(METRICS('event_count'), 0))"
        }
      ]
    }
  }
}

Debug Output

Panic Output

N/A

Expected Behavior

  1. Meric period should be set to 5 minutes
  2. event_count metric should be appear as unticked within the console (return_data = false)

Actual Behavior

  1. Metric period is set to 1 minute
  2. event_count metric is ticked within the console (return_data = true)
Image

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@connor-philip-ci connor-philip-ci changed the title sli.sli_metric.metric_data_queries.metric_stat.period value does not appear to get used awscc_applicationsignals_service_level_objective does not appear to respect set values Feb 6, 2025
@connor-philip-ci
Copy link
Author

I played around with this a bit more and once I changed the order of the metric_data_queries and it seemed to have an effect on return_data being respected or not:

resource "awscc_applicationsignals_service_level_objective" "example" {
  name        = "example"
  description = "example"

  goal = {
    attainment_goal   = 99.9
    warning_threshold = 99.0
    interval = {
      rolling_interval = {
        duration      = 30
        duration_unit = "DAY"
        start_time    = 1738853749
      }
    }
  }
  sli = {
    comparison_operator = "GreaterThan"
    metric_threshold    = 0

    sli_metric = {
      metric_data_queries = [
        {
          id = "event_count_filled"
          account_id = var.account_id
          return_data = true # <----- Set to true as expected
          expression = "SUM(FILL(METRICS('event_count'), 0))"
        },
        {
          id = "event_count"
          account_id = var.account_id
          return_data = false   # <----- This value now __does__ seem to be respected, set to false in console

          metric_stat = {
            period = 300  # <----- This still isn't respected, set to 1 minute in console
            stat   = "Sum"

            metric = {
              namespace   = "AWS/Logs"
              metric_name = "IncomingLogEvents"
              dimensions = [
                {
                  name  = "LogGroupName"
                  value = "example-log-group"
                }
              ]
            }
          }
        }
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant