-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 customized metric specification in autoscaling predictive scaling policy #22451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @gypdtc 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
In addition to the resource file and the test file, other files need to be edited as well
|
Hi Glenn, I have added another commit to address those questions, however, I could not find your later comment anywhere. If you could share a link that will be super helpful, thanks! |
Latest ACC test output:
|
ACC output:
|
Ready for your review @AdamTylerLynch. There are some design decisions made to align with the current iteration of the public documentation. When the public doc is updated, the docs here can be updated as well. The author is from the service team and is aware of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really strong first pull request! Wow! Thank you so much for your contribution.
I made some suggestion relating to readability and consistency.
I would also like to see another (or more predictive examples) that could inspire customers.
Acc test output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Requesting Hashi review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTS=TestAccAutoScalingPolicy_predictiveScaling PKG=autoscaling
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 20 -run='TestAccAutoScalingPolicy_predictiveScaling' -timeout 180m
=== RUN TestAccAutoScalingPolicy_predictiveScalingPredefined
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingPredefined
=== RUN TestAccAutoScalingPolicy_predictiveScalingCustom
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingCustom
=== RUN TestAccAutoScalingPolicy_predictiveScalingRemoved
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingRemoved
=== RUN TestAccAutoScalingPolicy_predictiveScalingUpdated
=== PAUSE TestAccAutoScalingPolicy_predictiveScalingUpdated
=== CONT TestAccAutoScalingPolicy_predictiveScalingPredefined
=== CONT TestAccAutoScalingPolicy_predictiveScalingRemoved
=== CONT TestAccAutoScalingPolicy_predictiveScalingUpdated
=== CONT TestAccAutoScalingPolicy_predictiveScalingCustom
--- PASS: TestAccAutoScalingPolicy_predictiveScalingCustom (66.73s)
--- PASS: TestAccAutoScalingPolicy_predictiveScalingPredefined (68.31s)
--- PASS: TestAccAutoScalingPolicy_predictiveScalingUpdated (106.13s)
--- PASS: TestAccAutoScalingPolicy_predictiveScalingRemoved (110.55s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling 116.006s
@gypdtc Thanks for the contribution 🎉 👏. |
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! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Proposed change to support custom metrics in predictive scaling policy.
I am new to Terraform/Golang so I basically tried to following existing pattern implementing the change and adding tests. Please let me know if it complies with your requirement.
Solved by using
TypeSet
rather thanTypeList
for dimensionsOne question is, I used one single dimension in my test,if I tried to use two dimensions in the test,
it seems the test would fail because at some step, the order of those two dimensions changed. I wonder is this just a limitation from testing or it indicates some issues in the implementation ?
Another thing I noticed is the resource label field is required in Terraform all the time,
where it is only required when
PredefinedMetricType
isALBTargetGroupRequestCount
in AWS. Just want to check if this discrepancy is by design.Community Note
Closes #22512.
Output from acceptance testing: