resource/alicloud_alidns_cloud_gtm_monitor_template: drop 0 from failure_rate enum - #10102
Open
api-tool-agent wants to merge 1 commit into
Open
resource/alicloud_alidns_cloud_gtm_monitor_template: drop 0 from failure_rate enum#10102api-tool-agent wants to merge 1 commit into
api-tool-agent wants to merge 1 commit into
Conversation
…ure_rate enum The failure_rate ValidateFunc accepted 0, but CreateCloudGtmMonitorTemplate / UpdateCloudGtmMonitorTemplate only support 20/50/80/100. Remove 0 from the valid set so configurations with failure_rate=0 fail at plan time rather than being sent to the API. Add an acceptance test covering failure_rate=100 (accepted) and failure_rate=0 (rejected by validation).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
The
failure_rateargument of thealicloud_alidns_cloud_gtm_monitor_templateresource accepted0in itsValidateFunc, but the backing APIs (CreateCloudGtmMonitorTemplate/UpdateCloudGtmMonitorTemplate) only support20 / 50 / 80 / 100. This removes0from the valid set so that invalid configurations fail at plan time instead of being sent to the API and rejected there.Test results
All acceptance tests pass:
A new acceptance test
TestAccAliCloudAlidnsCloudGtmMonitorTemplate_failureRateEnumis added to cover the enum change:failure_rate=100is accepted at create, whilefailure_rate=0is rejected by validation withexpected failure_rate to be one of [20 50 80 100].