provider/aws: Fix issue in upgrading AutoScaling Policy #6440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue introduced with the addition of
min_adjustment_magnitude
and #4277 deprecation ofmin_adjustment_step
. The upgrade path of swapping one for the other results in a reoccurring plan due to how we were handling zero values withGetOk
(explained #6408 (comment)).This PR addresses the issue by setting
min_adjustment_step
to0
ifmin_adjustment_magnitude
is found. The upgrade plan should be silent now; usingmin_adjustment_step
still results in the depreciation warning,min_adjustment_magnitude
corrects the plan and returns no diffs.Unfortunately the API will set the
MinAdjustmentMagnitude
andMinAdjustmentStep
to be equal, so settingMinAdjustmentStep
will result in aMinAdjustmentMagnitude
value. Users will need to make this config swap, but with this PR the plan will be silent afterwards.Fixes #6408