Skip to content

resource/alicloud_alidns_cloud_gtm_monitor_template: drop 0 from failure_rate enum - #10102

Open
api-tool-agent wants to merge 1 commit into
aliyun:masterfrom
api-tool-agent:worktree-84935782-failure-rate-enum
Open

resource/alicloud_alidns_cloud_gtm_monitor_template: drop 0 from failure_rate enum#10102
api-tool-agent wants to merge 1 commit into
aliyun:masterfrom
api-tool-agent:worktree-84935782-failure-rate-enum

Conversation

@api-tool-agent

Copy link
Copy Markdown
Collaborator

What does this PR do?

The failure_rate argument of the alicloud_alidns_cloud_gtm_monitor_template resource accepted 0 in its ValidateFunc, but the backing APIs (CreateCloudGtmMonitorTemplate / UpdateCloudGtmMonitorTemplate) only support 20 / 50 / 80 / 100. This removes 0 from 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:

=== RUN TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12684
--- PASS: TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12684 (5.69s)

=== RUN TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12685
--- PASS: TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12685 (11.21s)

=== RUN TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12690
--- PASS: TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12690 (8.28s)

=== RUN TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12691
--- PASS: TestAccAliCloudAlidnsCloudGtmMonitorTemplate_basic12691 (5.78s)

=== RUN TestAccAliCloudAlidnsCloudGtmMonitorTemplate_failureRateEnum
--- PASS: TestAccAliCloudAlidnsCloudGtmMonitorTemplate_failureRateEnum (5.01s)

A new acceptance test TestAccAliCloudAlidnsCloudGtmMonitorTemplate_failureRateEnum is added to cover the enum change: failure_rate=100 is accepted at create, while failure_rate=0 is rejected by validation with expected failure_rate to be one of [20 50 80 100].

…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).
@github-actions github-actions Bot added the size/M label Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant