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

metric alarm resource does not have support for trimmed mean statistic #22078

Closed
blackknight467 opened this issue Dec 7, 2021 · 6 comments · Fixed by #22942
Closed

metric alarm resource does not have support for trimmed mean statistic #22078

blackknight467 opened this issue Dec 7, 2021 · 6 comments · Fixed by #22942
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Milestone

Comments

@blackknight467
Copy link

Trying to create a metric alarm with Trimmed Mean (TM) results in the following error

│ Error: invalid value for extended_statistic (must specify a value between p0.0 and p100)

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

Terraform CLI and Terraform AWS Provider Version

Terraform v1.0.9
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.68.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.7.1
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/terraform-aws-modules/http v2.4.1

Affected Resource(s)

  • aws_cloudwatch_metric_alarm

Terraform Configuration Files

resource "aws_cloudwatch_metric_alarm" "example" {
  ...
  extended_statistic  = "tm99"
  ...
}

Debug Output

This fails the validation step

Panic Output

Expected Behavior

A metric alarm should be created with trimmed mean

Actual Behavior

Validation fails

Steps to Reproduce

Try to create a trimmed mean metric alarm

  1. terraform apply

Important Factoids

N/A

References

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. labels Dec 7, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 7, 2021
@ewbankkit
Copy link
Contributor

The tm99 and other statistics are show in the Console's drop-down:

Screen Shot 2021-12-07 at 12 06 34 PM

@xoob
Copy link
Contributor

xoob commented Jan 10, 2022

It looks like this is caused by the client-side validation at

ValidateFunc: validation.StringMatch(regexp.MustCompile(`p(\d{1,2}(\.\d{0,2})?|100)`), "must specify a value between p0.0 and p100"),
. Would it be feasible to remove the validation and let the AWS API decide what is an acceptable value?

@EpicWink
Copy link
Contributor

EpicWink commented Feb 4, 2022

Please also support the expandable statistics (docs), including one- and two-value arguments, and both percentage and absolute values

@EpicWink
Copy link
Contributor

EpicWink commented Feb 4, 2022

Related: #13622

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

This functionality has been released in v4.4.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants