diff --git a/azurerm/helpers/validate/compute.go b/azurerm/helpers/validate/compute.go index 49bbd89a155d..b7125797f9e6 100644 --- a/azurerm/helpers/validate/compute.go +++ b/azurerm/helpers/validate/compute.go @@ -41,7 +41,7 @@ func SharedImageName(v interface{}, k string) (ws []string, es []error) { func SharedImageVersionName(v interface{}, k string) (ws []string, es []error) { value := v.(string) - r, _ := regexp.Compile(`^([0-9]\.[0-9]\.[0-9])$`) + r, _ := regexp.Compile(`^([0-9]{1,10}\.[0-9]{1,10}\.[0-9]{1,10})$`) if !r.MatchString(value) { es = append(es, fmt.Errorf("Expected %s to be in the format `1.2.3` but got %q.", k, value)) } diff --git a/azurerm/resource_arm_shared_image_version_test.go b/azurerm/resource_arm_shared_image_version_test.go index a9ae0ec1835b..e4240a4a90b1 100644 --- a/azurerm/resource_arm_shared_image_version_test.go +++ b/azurerm/resource_arm_shared_image_version_test.go @@ -51,6 +51,7 @@ func TestAccAzureRMSharedImageVersion_basic(t *testing.T) { testCheckAzureRMSharedImageVersionExists(resourceName), resource.TestCheckResourceAttrSet(resourceName, "managed_image_id"), resource.TestCheckResourceAttr(resourceName, "target_region.#", "2"), + resource.TestCheckResourceAttr(resourceName, "name", "1234567890.1234567890.1234567890"), ), }, { @@ -181,7 +182,7 @@ func testAccAzureRMSharedImageVersion_imageVersionUpdated(rInt int, location, al %s resource "azurerm_shared_image_version" "test" { - name = "0.0.1" + name = "1234567890.1234567890.1234567890" gallery_name = "${azurerm_shared_image_gallery.test.name}" image_name = "${azurerm_shared_image.test.name}" resource_group_name = "${azurerm_resource_group.test.name}"