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

Support defining period in custom metrics for target tracking policies #41385

Conversation

carlosgaldino
Copy link
Contributor

Description

Following up from #41066, this patch adds the period field to the customized_metric_specification to allow overriding the period the metric is observed.

Relations

Relates #41066

References

Output from Acceptance Testing

% make testacc TESTS=TestAccAutoScalingPolicy PKG=autoscaling
...

My accounts don't support launch configuration so I can't test. It's the same reason as in the previous PR I opened before.

Following up from hashicorp#41066, this patch adds the `period` field to the
`customized_metric_specification` to allow overriding the period the
metric is observed.
@carlosgaldino carlosgaldino requested a review from a team as a code owner February 13, 2025 12:17
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/autoscaling Issues and PRs that pertain to the autoscaling service. needs-triage Waiting for first response or review from a maintainer. labels Feb 13, 2025
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 13, 2025
@ewbankkit ewbankkit self-assigned this Feb 24, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 24, 2025
…etTrackingConfiguration.customizedMetricSpecification.period' failed to satisfy constraint: Member must have value greater than or equal to 1".
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccAutoScalingPolicy_' PKG=autoscaling ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/autoscaling/... -v -count 1 -parallel 3  -run=TestAccAutoScalingPolicy_ -timeout 360m -vet=off
2025/02/24 08:13:33 Initializing Terraform AWS Provider...
=== RUN   TestAccAutoScalingPolicy_basic
=== PAUSE TestAccAutoScalingPolicy_basic
=== RUN   TestAccAutoScalingPolicy_disappears
=== PAUSE TestAccAutoScalingPolicy_disappears
=== RUN   TestAccAutoScalingPolicy_predictiveScalingPredefined
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingPredefined
=== RUN   TestAccAutoScalingPolicy_predictiveScalingResourceLabel
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingResourceLabel
=== RUN   TestAccAutoScalingPolicy_predictiveScalingCustom
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingCustom
=== RUN   TestAccAutoScalingPolicy_predictiveScalingRemoved
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingRemoved
=== RUN   TestAccAutoScalingPolicy_predictiveScalingUpdated
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingUpdated
=== RUN   TestAccAutoScalingPolicy_predictiveScalingFloatTargetValue
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingFloatTargetValue
=== RUN   TestAccAutoScalingPolicy_simpleScalingStepAdjustment
=== PAUSE TestAccAutoScalingPolicy_simpleScalingStepAdjustment
=== RUN   TestAccAutoScalingPolicy_TargetTrack_predefined
=== PAUSE TestAccAutoScalingPolicy_TargetTrack_predefined
=== RUN   TestAccAutoScalingPolicy_TargetTrack_custom
=== PAUSE TestAccAutoScalingPolicy_TargetTrack_custom
=== RUN   TestAccAutoScalingPolicy_TargetTrack_metricMath
=== PAUSE TestAccAutoScalingPolicy_TargetTrack_metricMath
=== RUN   TestAccAutoScalingPolicy_zeroValue
=== PAUSE TestAccAutoScalingPolicy_zeroValue
=== CONT  TestAccAutoScalingPolicy_basic
=== CONT  TestAccAutoScalingPolicy_predictiveScalingFloatTargetValue
=== CONT  TestAccAutoScalingPolicy_TargetTrack_custom
--- PASS: TestAccAutoScalingPolicy_TargetTrack_custom (58.26s)
=== CONT  TestAccAutoScalingPolicy_zeroValue
--- PASS: TestAccAutoScalingPolicy_predictiveScalingFloatTargetValue (71.05s)
=== CONT  TestAccAutoScalingPolicy_TargetTrack_metricMath
--- PASS: TestAccAutoScalingPolicy_zeroValue (72.09s)
=== CONT  TestAccAutoScalingPolicy_predictiveScalingCustom
--- PASS: TestAccAutoScalingPolicy_basic (133.51s)
=== CONT  TestAccAutoScalingPolicy_predictiveScalingUpdated
--- PASS: TestAccAutoScalingPolicy_TargetTrack_metricMath (92.53s)
=== CONT  TestAccAutoScalingPolicy_predictiveScalingRemoved
--- PASS: TestAccAutoScalingPolicy_predictiveScalingCustom (73.17s)
=== CONT  TestAccAutoScalingPolicy_TargetTrack_predefined
--- PASS: TestAccAutoScalingPolicy_predictiveScalingUpdated (112.35s)
=== CONT  TestAccAutoScalingPolicy_simpleScalingStepAdjustment
--- PASS: TestAccAutoScalingPolicy_predictiveScalingRemoved (94.91s)
=== CONT  TestAccAutoScalingPolicy_disappears
--- PASS: TestAccAutoScalingPolicy_TargetTrack_predefined (63.29s)
=== CONT  TestAccAutoScalingPolicy_predictiveScalingResourceLabel
--- PASS: TestAccAutoScalingPolicy_simpleScalingStepAdjustment (61.01s)
=== CONT  TestAccAutoScalingPolicy_predictiveScalingPredefined
--- PASS: TestAccAutoScalingPolicy_disappears (57.95s)
--- PASS: TestAccAutoScalingPolicy_predictiveScalingResourceLabel (64.60s)
--- PASS: TestAccAutoScalingPolicy_predictiveScalingPredefined (69.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	382.190s

@ewbankkit
Copy link
Contributor

@carlosgaldino Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 2ad136e into hashicorp:main Feb 24, 2025
44 checks passed
@github-actions github-actions bot added this to the v5.89.0 milestone Feb 24, 2025
@carlosgaldino carlosgaldino deleted the f-aws_autoscaling_policy-custom-metric-period branch February 24, 2025 22:30
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 28, 2025
Copy link

This functionality has been released in v5.89.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants