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: Setting default values for scale_in_protected_instances and standby_instances as per documentation #33382

Merged
merged 7 commits into from
Sep 11, 2023

Conversation

adiospeds
Copy link
Contributor

@adiospeds adiospeds commented Sep 8, 2023

Description

Since #33310 was merged we are getting below error:

│ Error: starting Auto Scaling Group (terraform-x) instance refresh: ValidationError: 2 validation errors detected: 
Value '' at 'preferences.scaleInProtectedInstances' failed to satisfy constraint: Member must satisfy enum value set: [Ignore, Wait, Refresh]; 
Value '' at 'preferences.standbyInstances' failed to satisfy constraint: Member must satisfy enum value set: [Terminate, Ignore, Wait]

While the documentation for the above parameters says the Default value for the above arguments scale_in_protected_instances and standby_instances is Wait I think we forgot to add it to the code.

Relations

Relates #33310.
Closes #33377.

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

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. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels Sep 8, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 8, 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 @adiospeds 👋

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

@mhowell-ims
Copy link

I wonder if 'Wait' is actually the right option for the default value. Using 'Wait' actually requires manual intervention if it gets triggered, which seems to go against the spirit of infrastructure-as-code. It would also cause the instance refresh to 'pause' for up to an hour while waiting for manual intervention to occur, which could cause other issues. The AWS web console actually recommends 'Ignore' for both of these settings.
Screenshot 2023-09-08 at 5 29 44 PM

@adiospeds
Copy link
Contributor Author

adiospeds commented Sep 8, 2023

@mhowell-ims I agree to what you are saying. During troubleshooting this bug, Wait seemed a better option but longer term and as recommended by AWS GUI above, Ignore seems to be even more better option. Thank you for the suggestion and making this fix better. Pushing the change for your suggestion and I'll also have the documentation updated.

@adiospeds adiospeds force-pushed the fix/instance_refresh-parameters branch from 6a3fb8c to a2b54a5 Compare September 8, 2023 23:40
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 11, 2023
@ewbankkit ewbankkit self-assigned this Sep 11, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 11, 2023
% make testacc TESTARGS='-run=TestAccAutoScalingGroup_InstanceRefresh_' PKG=autoscaling ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 3  -run=TestAccAutoScalingGroup_InstanceRefresh_ -timeout 180m
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_basic
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_basic
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_start
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_start
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_triggers
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_triggers
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_basic
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_triggers
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_autoRollback (188.24s)
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_start
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_triggers (212.21s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_basic (344.02s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_start (262.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	456.268s
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=TestAccAutoScalingGroup_InstanceRefresh_' PKG=autoscaling ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/autoscaling/... -v -count 1 -parallel 3  -run=TestAccAutoScalingGroup_InstanceRefresh_ -timeout 180m
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_basic
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_basic
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_start
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_start
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_triggers
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_triggers
=== RUN   TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== PAUSE TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_basic
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_autoRollback
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_triggers
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_autoRollback (188.24s)
=== CONT  TestAccAutoScalingGroup_InstanceRefresh_start
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_triggers (212.21s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_basic (344.02s)
--- PASS: TestAccAutoScalingGroup_InstanceRefresh_start (262.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling	456.268s

@ewbankkit
Copy link
Contributor

@adiospeds Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit a2ea40a into hashicorp:main Sep 11, 2023
41 checks passed
@github-actions github-actions bot added this to the v5.17.0 milestone Sep 11, 2023
@YakDriver YakDriver modified the milestones: v5.17.0, v5.16.2 Sep 11, 2023
@github-actions
Copy link

This functionality has been released in v5.16.2 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 github-actions bot removed the bug Addresses a defect in current functionality. label Sep 11, 2023
@github-actions
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 Oct 12, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/autoscaling Issues and PRs that pertain to the autoscaling service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Auto scaling instance refresh fails with validation errors
5 participants