-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
r/aws_appautoscaling_policy:Enable Metric Math support for TargetTrackingPolicy in Application Au… #30172
r/aws_appautoscaling_policy:Enable Metric Math support for TargetTrackingPolicy in Application Au… #30172
Conversation
Community NoteVoting for Prioritization
For Submitters
|
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 @snghffc 👋
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 CONTRIBUTOR 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! 😃
Update on Apr 11, 2023: I have submitted my review officially and deleted the original message to avoid confusion. |
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.
I am an author on #28560. The acceptance testing covers all combinations of metric data queries, e.g. expression with metric stat, standalone expression, expression relying on other metric data queries, metric with dimensions, and metric without dimensions. Hence, this PR looks good to me.
Hi, Do you know when this feature will be merged and if it will be available for aws provider version 3? |
Still waiting on this one. Does it need further review? Is it worth tagging those who reviewed #28560? |
@ewbankkit Can we please get some help on this PR? |
… Headings should be surrounded by blank lines' and 'MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines'.
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 TESTARGS='-run=TestAccAppAutoScalingPolicy_' PKG=appautoscaling ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appautoscaling/... -v -count 1 -parallel 2 -run=TestAccAppAutoScalingPolicy_ -timeout 180m
=== RUN TestAccAppAutoScalingPolicy_basic
=== PAUSE TestAccAppAutoScalingPolicy_basic
=== RUN TestAccAppAutoScalingPolicy_disappears
=== PAUSE TestAccAppAutoScalingPolicy_disappears
=== RUN TestAccAppAutoScalingPolicy_scaleOutAndIn
=== PAUSE TestAccAppAutoScalingPolicy_scaleOutAndIn
=== RUN TestAccAppAutoScalingPolicy_spotFleetRequest
=== PAUSE TestAccAppAutoScalingPolicy_spotFleetRequest
=== RUN TestAccAppAutoScalingPolicy_DynamoDB_table
=== PAUSE TestAccAppAutoScalingPolicy_DynamoDB_table
=== RUN TestAccAppAutoScalingPolicy_DynamoDB_index
=== PAUSE TestAccAppAutoScalingPolicy_DynamoDB_index
=== RUN TestAccAppAutoScalingPolicy_multiplePoliciesSameName
=== PAUSE TestAccAppAutoScalingPolicy_multiplePoliciesSameName
=== RUN TestAccAppAutoScalingPolicy_multiplePoliciesSameResource
=== PAUSE TestAccAppAutoScalingPolicy_multiplePoliciesSameResource
=== RUN TestAccAppAutoScalingPolicy_ResourceID_forceNew
=== PAUSE TestAccAppAutoScalingPolicy_ResourceID_forceNew
=== RUN TestAccAppAutoScalingPolicy_TargetTrack_metricMath
=== PAUSE TestAccAppAutoScalingPolicy_TargetTrack_metricMath
=== CONT TestAccAppAutoScalingPolicy_basic
=== CONT TestAccAppAutoScalingPolicy_DynamoDB_index
--- PASS: TestAccAppAutoScalingPolicy_DynamoDB_index (36.41s)
=== CONT TestAccAppAutoScalingPolicy_spotFleetRequest
--- PASS: TestAccAppAutoScalingPolicy_basic (78.27s)
=== CONT TestAccAppAutoScalingPolicy_DynamoDB_table
--- PASS: TestAccAppAutoScalingPolicy_DynamoDB_table (27.88s)
=== CONT TestAccAppAutoScalingPolicy_scaleOutAndIn
--- PASS: TestAccAppAutoScalingPolicy_spotFleetRequest (82.96s)
=== CONT TestAccAppAutoScalingPolicy_disappears
--- PASS: TestAccAppAutoScalingPolicy_scaleOutAndIn (81.02s)
=== CONT TestAccAppAutoScalingPolicy_ResourceID_forceNew
--- PASS: TestAccAppAutoScalingPolicy_disappears (74.80s)
=== CONT TestAccAppAutoScalingPolicy_TargetTrack_metricMath
--- PASS: TestAccAppAutoScalingPolicy_TargetTrack_metricMath (77.71s)
=== CONT TestAccAppAutoScalingPolicy_multiplePoliciesSameResource
--- PASS: TestAccAppAutoScalingPolicy_ResourceID_forceNew (90.37s)
=== CONT TestAccAppAutoScalingPolicy_multiplePoliciesSameName
--- PASS: TestAccAppAutoScalingPolicy_multiplePoliciesSameName (25.74s)
--- PASS: TestAccAppAutoScalingPolicy_multiplePoliciesSameResource (32.18s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling 309.268s
% make testacc TESTARGS='-run=TestAccAppAutoScalingTarget_' PKG=appautoscaling ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appautoscaling/... -v -count 1 -parallel 3 -run=TestAccAppAutoScalingTarget_ -timeout 180m
=== RUN TestAccAppAutoScalingTarget_basic
=== PAUSE TestAccAppAutoScalingTarget_basic
=== RUN TestAccAppAutoScalingTarget_disappears
=== PAUSE TestAccAppAutoScalingTarget_disappears
=== RUN TestAccAppAutoScalingTarget_tags
=== PAUSE TestAccAppAutoScalingTarget_tags
=== RUN TestAccAppAutoScalingTarget_spotFleetRequest
=== PAUSE TestAccAppAutoScalingTarget_spotFleetRequest
=== RUN TestAccAppAutoScalingTarget_emrCluster
=== PAUSE TestAccAppAutoScalingTarget_emrCluster
=== RUN TestAccAppAutoScalingTarget_multipleTargets
=== PAUSE TestAccAppAutoScalingTarget_multipleTargets
=== RUN TestAccAppAutoScalingTarget_optionalRoleARN
=== PAUSE TestAccAppAutoScalingTarget_optionalRoleARN
=== CONT TestAccAppAutoScalingTarget_basic
=== CONT TestAccAppAutoScalingTarget_emrCluster
=== CONT TestAccAppAutoScalingTarget_tags
--- PASS: TestAccAppAutoScalingTarget_tags (52.60s)
=== CONT TestAccAppAutoScalingTarget_spotFleetRequest
--- PASS: TestAccAppAutoScalingTarget_basic (80.80s)
=== CONT TestAccAppAutoScalingTarget_disappears
--- PASS: TestAccAppAutoScalingTarget_spotFleetRequest (83.75s)
=== CONT TestAccAppAutoScalingTarget_optionalRoleARN
--- PASS: TestAccAppAutoScalingTarget_optionalRoleARN (25.10s)
=== CONT TestAccAppAutoScalingTarget_multipleTargets
--- PASS: TestAccAppAutoScalingTarget_multipleTargets (25.95s)
--- PASS: TestAccAppAutoScalingTarget_disappears (84.06s)
--- PASS: TestAccAppAutoScalingTarget_emrCluster (612.71s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling 618.376s
Thank you so much @ewbankkit for your help on this PR. |
Hi, will this be available for aws provider version 3 as well? |
@snghffc @ewbankkit thanks for the additions. However, the provider is now erroring when trying to refresh state for existing targets without tags:
|
Yes also receiving the above error. |
Also receiving this error:
│ Error: listing tags for Application Auto Scaling Target (): InvalidParameter: 1 validation error(s) found.│ - minimum field size of 1, ListTagsForResourceInput.ResourceARN. |
Can you please share more details about the error? |
For my use case this is my resource block:
This resource block is working fine in 4.65.0. |
Terraform works with 4.65 for Autoscaling (No Code Changes in the Terraform), however something has been introduced in 4.66 that is producing the above error. Its almost like listing tags are now a required field. However in my code I have no tags listed. This works on 4.65. resource "aws_appautoscaling_target" "service_autoscale" { |
we are also facing this issue, our block is similar to yours @tribecar-shurn and with 4.66.0 it also started breaking. We are not having any tags in the resource block The error we are receving is:
|
the bug ( #31180 ) in version 4.66 can be related to this commit ? |
Looks like the same issue. |
Hi, I am facing the same issue, I must untick the checkbox named "Use service auto scaling" then this issue has gone. error details: The refreshed state will be used to calculate this plan, but will not be module.main.module.service.module.service.data.aws_ecs_cluster.this: Refreshing state... [id=arn:aws:ecs:xxxx:cluster/APP-ECS] Error: listing tags for Application Auto Scaling Target (): InvalidParameter: 1 validation error(s) found.
##[error]Error: The process '/usr/bin/bash' failed because one or more lines were written to the STDERR stream |
Does this change mandate some code updates which are not yet published in the registry? |
We have this bug also. We just upgraded Terraform from 1.1.7 -> 1.4.6. I reported it and another team in the company has seen it also but they didn't do any upgrade, it just started happening for them, they are using version 0.14.6. Another strange thing: deployments in 2x other environments was fine but only occurs in 1 environment. It seems to be random. |
We have the same thing happening in our environment. What I found was that it fails for older scalable targets. If you run:
you'll find that some scalable targets do not return a ScalableTargetARN. It appears that only those created more recently have one. I believe the code will need to account for this. If you don't have a ScalableTargetARN, you can't create a tag on the resource. We are going to raise the issue w/AWS this morning, but thinking the code needs to be updated in the meantime. |
This functionality has been released in v4.66.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. |
Description
This PR enables Metric Math support for Applicationn AutoScaling TargetTracking policy. The feature was release on March 15, 2023.
https://aws.amazon.com/about-aws/whats-new/2023/03/application-auto-scaling-metric-math-target-tracking-policies/
Relations
Closes #30049.
Closes #28391.
References
Output from Acceptance Testing
Similar to EC2 AutoScaling PR: #28560