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

Fix: FindScheduledAction in aws_appautoscaling #34382

Conversation

colinfish-toast
Copy link
Contributor

@colinfish-toast colinfish-toast commented Nov 14, 2023

Description:

This Pull Request introduces a fix to the FindScheduledAction function in the aws_appautoscaling module by adding the ability to accurately differentiate between scheduled actions that share the same name but are associated with different scalable dimensions. This bug led to incorrect read behavior, where the attributes of one action might be erroneously applied to another, especially noticeable in Terraform plans and applies. This change is particularly relevant for resources like DynamoDB tables, where scheduled actions for both read and write capacities might share a common name.

Relations

Closes #33873
Closes #36098

References

Relevant API Documentation: https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/put-scheduled-action.html#:~:text=Each%20scalable%20target%20is%20identified%20by%20a%20service%20namespace%2C%20resource%20ID%2C%20and%20scalable%20dimension

Output from Acceptance Testing

$   make testacc TESTS=testAccCheckScheduledActionExists PKG=appautoscaling
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/appautoscaling/... -v -count 1 -parallel 20 -run='testAccCheckScheduledActionExists'  -timeout 360m
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling	2.999s [no tests to run]

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 size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/appautoscaling Issues and PRs that pertain to the appautoscaling service. labels Nov 14, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 14, 2023
@colinfish-toast colinfish-toast changed the title Fix FindScheduledAction in aws_appautoscaling to distinguish same-nam… [WIP] Fix FindScheduledAction in aws_appautoscaling to distinguish same-nam… Nov 14, 2023
@colinfish-toast colinfish-toast changed the title [WIP] Fix FindScheduledAction in aws_appautoscaling to distinguish same-nam… [WIP] Fix FindScheduledAction in aws_appautoscaling Nov 14, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @colinfish-toast 👋

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! 😃

@colinfish-toast colinfish-toast changed the title [WIP] Fix FindScheduledAction in aws_appautoscaling Fix FindScheduledAction in aws_appautoscaling Nov 14, 2023
@colinfish-toast colinfish-toast changed the title Fix FindScheduledAction in aws_appautoscaling Fix: FindScheduledAction in aws_appautoscaling Nov 14, 2023
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 14, 2023
@colinfish-toast
Copy link
Contributor Author

@justinretzolk Apologies, this is my first PR on this repo. Is there anything I can be doing to improve the chances of this getting merged?

@colinfish-toast
Copy link
Contributor Author

colinfish-toast commented Dec 12, 2023

bump @justinretzolk, apologies if you're not the right person to ask this. Is there anything I can do to help get this fix into the next release?

@colinfish-toast
Copy link
Contributor Author

colinfish-toast commented Feb 13, 2024

@justinretzolk @ewbankkit Is there anything I can do to help get this fix into the next release?

@justinretzolk
Copy link
Member

Hey @colinfish-toast 👋 Thanks for checking in here, and sorry I missed your last couple of pings! I can't speak to when this will be prioritized just yet. We base our prioritization on the count of 👍 reactions and a few other considerations (more information: prioritization guide).

@colinfish-toast
Copy link
Contributor Author

@justinretzolk thank you for the context and link to the prioritization guide! 🤞🤞

@mattbrennan-toast
Copy link

👍

emmetrowe-toast

This comment was marked as off-topic.

@johnprasad-toast
Copy link

👍

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=TestAccAppAutoScalingScheduledAction_' PKG=appautoscaling
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/appautoscaling/... -v -count 1 -parallel 20  -run=TestAccAppAutoScalingScheduledAction_ -timeout 360m
=== RUN   TestAccAppAutoScalingScheduledAction_dynamoDB
=== PAUSE TestAccAppAutoScalingScheduledAction_dynamoDB
=== RUN   TestAccAppAutoScalingScheduledAction_disappears
=== PAUSE TestAccAppAutoScalingScheduledAction_disappears
=== RUN   TestAccAppAutoScalingScheduledAction_ecs
=== PAUSE TestAccAppAutoScalingScheduledAction_ecs
=== RUN   TestAccAppAutoScalingScheduledAction_emr
=== PAUSE TestAccAppAutoScalingScheduledAction_emr
=== RUN   TestAccAppAutoScalingScheduledAction_Name_duplicate
=== PAUSE TestAccAppAutoScalingScheduledAction_Name_duplicate
=== RUN   TestAccAppAutoScalingScheduledAction_spotFleet
=== PAUSE TestAccAppAutoScalingScheduledAction_spotFleet
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleAtExpression_timezone
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleAtExpression_timezone
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_basic
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_basic
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_timezone
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_timezone
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_startEndTimeTimezone
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_startEndTimeTimezone
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_basic
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_basic
=== RUN   TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_timezone
=== PAUSE TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_timezone
=== RUN   TestAccAppAutoScalingScheduledAction_minCapacity
=== PAUSE TestAccAppAutoScalingScheduledAction_minCapacity
=== RUN   TestAccAppAutoScalingScheduledAction_maxCapacity
=== PAUSE TestAccAppAutoScalingScheduledAction_maxCapacity
=== CONT  TestAccAppAutoScalingScheduledAction_dynamoDB
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_basic
=== CONT  TestAccAppAutoScalingScheduledAction_minCapacity
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_basic
=== CONT  TestAccAppAutoScalingScheduledAction_spotFleet
=== CONT  TestAccAppAutoScalingScheduledAction_emr
=== CONT  TestAccAppAutoScalingScheduledAction_disappears
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_timezone
=== CONT  TestAccAppAutoScalingScheduledAction_Name_duplicate
=== CONT  TestAccAppAutoScalingScheduledAction_maxCapacity
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_timezone
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_startEndTimeTimezone
=== CONT  TestAccAppAutoScalingScheduledAction_ecs
=== CONT  TestAccAppAutoScalingScheduledAction_ScheduleAtExpression_timezone
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_basic (80.02s)
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_basic (84.70s)
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_timezone (85.85s)
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleAtExpression_timezone (87.58s)
--- PASS: TestAccAppAutoScalingScheduledAction_Name_duplicate (87.80s)
--- PASS: TestAccAppAutoScalingScheduledAction_disappears (87.97s)
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_timezone (90.70s)
--- PASS: TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_startEndTimeTimezone (102.34s)
--- PASS: TestAccAppAutoScalingScheduledAction_dynamoDB (108.98s)
--- PASS: TestAccAppAutoScalingScheduledAction_spotFleet (115.83s)
--- PASS: TestAccAppAutoScalingScheduledAction_maxCapacity (123.16s)
--- PASS: TestAccAppAutoScalingScheduledAction_minCapacity (124.70s)
--- PASS: TestAccAppAutoScalingScheduledAction_ecs (132.57s)
--- PASS: TestAccAppAutoScalingScheduledAction_emr (576.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling	584.077s

@ewbankkit
Copy link
Contributor

@colinfish-toast Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 12413a5 into hashicorp:main Mar 18, 2024
36 checks passed
@github-actions github-actions bot added this to the v5.42.0 milestone Mar 18, 2024
Copy link

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

Copy link

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.
If you have found a problem that seems related to this change, 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 Apr 22, 2024
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/appautoscaling Issues and PRs that pertain to the appautoscaling service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
6 participants