From 5926fba371b5e8464f7ecb1ea5dc2a5fed4806c9 Mon Sep 17 00:00:00 2001 From: teowa <104055472+teowa@users.noreply.github.com> Date: Mon, 25 Sep 2023 05:25:26 +0000 Subject: [PATCH] fix version validation --- .../resource_deployment_script_common.go | 132 ++---------------- ..._deployment_script_azure_cli.html.markdown | 2 +- ...ent_script_azure_power_shell.html.markdown | 2 +- 3 files changed, 10 insertions(+), 126 deletions(-) diff --git a/internal/services/resource/resource_deployment_script_common.go b/internal/services/resource/resource_deployment_script_common.go index ae8239645f7e0..050d4eac60bfb 100644 --- a/internal/services/resource/resource_deployment_script_common.go +++ b/internal/services/resource/resource_deployment_script_common.go @@ -222,133 +222,17 @@ func getDeploymentScriptArguments(kind DeploymentScriptKind) map[string]*plugins if kind == AzurePowerShellKind { result["version"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "2.7", - "2.8", - "3.0", - "3.1", - "3.2", - "3.3", - "3.4", - "3.5", - "3.6", - "3.7", - "3.8", - "4.1", - "4.2", - "4.3", - "4.4", - "4.5", - "4.6", - "4.7", - "4.8", - "5.0", - "5.1", - "5.2", - "5.3", - "5.4", - "5.5", - "5.6", - "5.7", - "5.8", - "5.9", - "6.0", - "6.1", - "6.2", - "6.3", - "6.4", - "6.5", - "6.6", - "7.0", - "7.1", - "7.2", - "7.3", - "7.4", - "7.5", - "8.0", - "8.1", - "8.2", - "8.3", - "9.0", - }, false), + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, } } else { result["version"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "2.0.77", - "2.0.78", - "2.0.79", - "2.0.80", - "2.0.81", - "2.1.0", - "2.10.0", - "2.10.1", - "2.11.0", - "2.11.1", - "2.12.0", - "2.12.1", - "2.13.0", - "2.14.0", - "2.14.1", - "2.14.2", - "2.15.0", - "2.15.1", - "2.16.0", - "2.17.0", - "2.17.1", - "2.18.0", - "2.19.0", - "2.19.1", - "2.2.0", - "2.20.0", - "2.21.0", - "2.22.0", - "2.22.1", - "2.23.0", - "2.24.0", - "2.24.1", - "2.24.2", - "2.25.0", - "2.26.0", - "2.26.1", - "2.27.0", - "2.27.1", - "2.27.2", - "2.28.0", - "2.29.0", - "2.29.1", - "2.29.2", - "2.3.0", - "2.3.1", - "2.30.0", - "2.31.0", - "2.32.0", - "2.33.0", - "2.33.1", - "2.34.0", - "2.34.1", - "2.35.0", - "2.36.0", - "2.37.0", - "2.38.0", - "2.39.0", - "2.4.0", - "2.40.0", - "2.41.0", - "2.5.0", - "2.5.1", - "2.6.0", - "2.7.0", - "2.8.0", - "2.9.0", - "2.9.1", - }, false), + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, } } diff --git a/website/docs/r/resource_deployment_script_azure_cli.html.markdown b/website/docs/r/resource_deployment_script_azure_cli.html.markdown index 0e873df48a025..b42d3f53001f0 100644 --- a/website/docs/r/resource_deployment_script_azure_cli.html.markdown +++ b/website/docs/r/resource_deployment_script_azure_cli.html.markdown @@ -62,7 +62,7 @@ The following arguments are supported: * `location` - (Required) Specifies the Azure Region where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. -* `version` - (Required) Azure CLI module version to be used. The supported versions are `2.0.77`, `2.0.78`, `2.0.79`, `2.0.80`, `2.0.81`, `2.1.0`, `2.10.0`, `2.10.1`, `2.11.0`, `2.11.1`, `2.12.0`, `2.12.1`, `2.13.0`, `2.14.0`, `2.14.1`, `2.14.2`, `2.15.0`, `2.15.1`, `2.16.0`, `2.17.0`, `2.17.1`, `2.18.0`, `2.19.0`, `2.19.1`, `2.2.0`, `2.20.0`, `2.21.0`, `2.22.0`, `2.22.1`, `2.23.0`, `2.24.0`, `2.24.1`, `2.24.2`, `2.25.0`, `2.26.0`, `2.26.1`, `2.27.0`, `2.27.1`, `2.27.2`, `2.28.0`, `2.29.0`, `2.29.1`, `2.29.2`, `2.3.0`, `2.3.1`, `2.30.0`, `2.31.0`, `2.32.0`, `2.33.0`, `2.33.1`, `2.34.0`, `2.34.1`, `2.35.0`, `2.36.0`, `2.37.0`, `2.38.0`, `2.39.0`, `2.4.0`, `2.40.0`, `2.41.0`, `2.5.0`, `2.5.1`, `2.6.0`, `2.7.0`, `2.8.0`, `2.9.0`, `2.9.1`. Changing this forces a new Resource Deployment Script to be created. +* `version` - (Required) Azure CLI module version to be used. The supported versions includes but not limited to `2.0.77`, `2.0.78`, `2.0.79`, `2.0.80`, `2.0.81`, `2.1.0`, `2.10.0`, `2.10.1`, `2.11.0`, `2.11.1`, `2.12.0`, `2.12.1`, `2.13.0`, `2.14.0`, `2.14.1`, `2.14.2`, `2.15.0`, `2.15.1`, `2.16.0`, `2.17.0`, `2.17.1`, `2.18.0`, `2.19.0`, `2.19.1`, `2.2.0`, `2.20.0`, `2.21.0`, `2.22.0`, `2.22.1`, `2.23.0`, `2.24.0`, `2.24.1`, `2.24.2`, `2.25.0`, `2.26.0`, `2.26.1`, `2.27.0`, `2.27.1`, `2.27.2`, `2.28.0`, `2.29.0`, `2.29.1`, `2.29.2`, `2.3.0`, `2.3.1`, `2.30.0`, `2.31.0`, `2.32.0`, `2.33.0`, `2.33.1`, `2.34.0`, `2.34.1`, `2.35.0`, `2.36.0`, `2.37.0`, `2.38.0`, `2.39.0`, `2.4.0`, `2.40.0`, `2.41.0`, `2.5.0`, `2.5.1`, `2.6.0`, `2.7.0`, `2.8.0`, `2.9.0`, `2.9.1`. Please refer to https://aka.ms/DeploymentScriptsTroubleshoot for more details. Changing this forces a new Resource Deployment Script to be created. * `retention_interval` - (Required) Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. The time duration should be between `1` hour and `26` hours (inclusive) and should be specified in ISO 8601 format. Changing this forces a new Resource Deployment Script to be created. diff --git a/website/docs/r/resource_deployment_script_azure_power_shell.html.markdown b/website/docs/r/resource_deployment_script_azure_power_shell.html.markdown index e96fe8e154921..8550cbc149878 100644 --- a/website/docs/r/resource_deployment_script_azure_power_shell.html.markdown +++ b/website/docs/r/resource_deployment_script_azure_power_shell.html.markdown @@ -66,7 +66,7 @@ The following arguments are supported: * `location` - (Required) Specifies the Azure Region where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. -* `version` - (Required) Azure PowerShell module version to be used. The supported versions are `2.7`, `2.8`, `3.0`, `3.1`, `3.2`, `3.3`, `3.4`, `3.5`, `3.6`, `3.7`, `3.8`, `4.1`, `4.2`, `4.3`, `4.4`, `4.5`, `4.6`, `4.7`, `4.8`, `5.0`, `5.1`, `5.2`, `5.3`, `5.4`, `5.5`, `5.6`, `5.7`, `5.8`, `5.9`, `6.0`, `6.1`, `6.2`, `6.3`, `6.4`, `6.5`, `6.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `7.5`, `8.0`, `8.1`, `8.2`, `8.3`, `9.0`. Changing this forces a new Resource Deployment Script to be created. +* `version` - (Required) Azure PowerShell module version to be used. The supported versions include but not limited to `2.7`, `2.8`, `3.0`, `3.1`, `3.2`, `3.3`, `3.4`, `3.5`, `3.6`, `3.7`, `3.8`, `4.1`, `4.2`, `4.3`, `4.4`, `4.5`, `4.6`, `4.7`, `4.8`, `5.0`, `5.1`, `5.2`, `5.3`, `5.4`, `5.5`, `5.6`, `5.7`, `5.8`, `5.9`, `6.0`, `6.1`, `6.2`, `6.3`, `6.4`, `6.5`, `6.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `7.5`, `8.0`, `8.1`, `8.2`, `8.3`, `9.0`. Please refer to https://aka.ms/DeploymentScriptsTroubleshoot for more details. Changing this forces a new Resource Deployment Script to be created. * `retention_interval` - (Required) Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. The time duration should be between `1` hour and `26` hours (inclusive) and should be specified in ISO 8601 format. Changing this forces a new Resource Deployment Script to be created.