diff --git a/azurerm/resource_arm_autoscale_setting_test.go b/azurerm/resource_arm_autoscale_setting_test.go index c8a2f6c958a7e..3398f1428d643 100644 --- a/azurerm/resource_arm_autoscale_setting_test.go +++ b/azurerm/resource_arm_autoscale_setting_test.go @@ -5,7 +5,6 @@ import ( "net/http" "testing" - "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -14,9 +13,8 @@ import ( func TestAccAzureRMAutoScaleSetting_basic(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMAutoScaleSetting_basic(ri, rs, location) + config := testAccAzureRMAutoScaleSetting_basic(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -47,9 +45,8 @@ func TestAccAzureRMAutoScaleSetting_basic(t *testing.T) { func TestAccAzureRMAutoScaleSetting_multipleProfiles(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMAutoScaleSetting_multipleProfiles(ri, rs, location) + config := testAccAzureRMAutoScaleSetting_multipleProfiles(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -73,7 +70,6 @@ func TestAccAzureRMAutoScaleSetting_multipleProfiles(t *testing.T) { func TestAccAzureRMAutoScaleSetting_update(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -82,18 +78,18 @@ func TestAccAzureRMAutoScaleSetting_update(t *testing.T) { CheckDestroy: testCheckAzureRMAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMAutoScaleSetting_capacity(ri, rs, location, 1, 3, 2), + Config: testAccAzureRMAutoScaleSetting_capacity(ri, location, 1, 3, 2), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), resource.TestCheckResourceAttr(resourceName, "profile.#", "1"), resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.minimum", "1"), - resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.maximum", "2"), - resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.default", "4"), + resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.maximum", "3"), + resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.default", "2"), ), }, { - Config: testAccAzureRMAutoScaleSetting_capacity(ri, rs, location, 2, 4, 3), + Config: testAccAzureRMAutoScaleSetting_capacity(ri, location, 2, 4, 3), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), @@ -104,7 +100,7 @@ func TestAccAzureRMAutoScaleSetting_update(t *testing.T) { ), }, { - Config: testAccAzureRMAutoScaleSetting_capacity(ri, rs, location, 2, 45, 3), + Config: testAccAzureRMAutoScaleSetting_capacity(ri, location, 2, 45, 3), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), @@ -121,7 +117,6 @@ func TestAccAzureRMAutoScaleSetting_update(t *testing.T) { func TestAccAzureRMAutoScaleSetting_multipleRules(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -130,7 +125,7 @@ func TestAccAzureRMAutoScaleSetting_multipleRules(t *testing.T) { CheckDestroy: testCheckAzureRMAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMAutoScaleSetting_basic(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_basic(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), @@ -142,7 +137,7 @@ func TestAccAzureRMAutoScaleSetting_multipleRules(t *testing.T) { ), }, { - Config: testAccAzureRMAutoScaleSetting_multipleRules(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_multipleRules(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), @@ -161,7 +156,6 @@ func TestAccAzureRMAutoScaleSetting_multipleRules(t *testing.T) { func TestAccAzureRMAutoScaleSetting_customEmails(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -170,7 +164,7 @@ func TestAccAzureRMAutoScaleSetting_customEmails(t *testing.T) { CheckDestroy: testCheckAzureRMAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMAutoScaleSetting_email(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_email(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -180,7 +174,7 @@ func TestAccAzureRMAutoScaleSetting_customEmails(t *testing.T) { ), }, { - Config: testAccAzureRMAutoScaleSetting_emailUpdated(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_emailUpdated(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -197,9 +191,8 @@ func TestAccAzureRMAutoScaleSetting_customEmails(t *testing.T) { func TestAccAzureRMAutoScaleSetting_recurrence(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMAutoScaleSetting_recurrence(ri, rs, location) + config := testAccAzureRMAutoScaleSetting_recurrence(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -229,7 +222,6 @@ func TestAccAzureRMAutoScaleSetting_recurrence(t *testing.T) { func TestAccAzureRMAutoScaleSetting_recurrenceUpdate(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -238,7 +230,7 @@ func TestAccAzureRMAutoScaleSetting_recurrenceUpdate(t *testing.T) { CheckDestroy: testCheckAzureRMAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMAutoScaleSetting_recurrence(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_recurrence(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -251,7 +243,7 @@ func TestAccAzureRMAutoScaleSetting_recurrenceUpdate(t *testing.T) { ), }, { - Config: testAccAzureRMAutoScaleSetting_recurrenceUpdated(ri, rs, location), + Config: testAccAzureRMAutoScaleSetting_recurrenceUpdated(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "profile.0.recurrence.#", "1"), @@ -270,9 +262,8 @@ func TestAccAzureRMAutoScaleSetting_recurrenceUpdate(t *testing.T) { func TestAccAzureRMAutoScaleSetting_fixedDate(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMAutoScaleSetting_fixedDate(ri, rs, location) + config := testAccAzureRMAutoScaleSetting_fixedDate(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -354,8 +345,8 @@ func testCheckAzureRMAutoScaleSettingDestroy(s *terraform.State) error { return nil } -func testAccAzureRMAutoScaleSetting_basic(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_basic(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -398,8 +389,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_multipleProfiles(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_multipleProfiles(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -485,8 +476,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_multipleRules(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_multipleRules(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -550,8 +541,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_capacity(rInt int, rString string, location string, min int, max int, defaultVal int) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_capacity(rInt int, location string, min int, max int, defaultVal int) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -595,8 +586,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, defaultVal, min, max) } -func testAccAzureRMAutoScaleSetting_email(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_email(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -647,8 +638,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, rInt) } -func testAccAzureRMAutoScaleSetting_emailUpdated(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_emailUpdated(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -699,8 +690,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, rInt, rInt) } -func testAccAzureRMAutoScaleSetting_recurrence(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_recurrence(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -743,8 +734,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_recurrenceUpdated(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_recurrenceUpdated(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -787,8 +778,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_fixedDate(rInt int, rString string, location string) string { - template := testAccAzureRMAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMAutoScaleSetting_fixedDate(rInt int, location string) string { + template := testAccAzureRMAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -817,7 +808,7 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMAutoScaleSetting_template(rInt int, rString string, location string) string { +func testAccAzureRMAutoScaleSetting_template(rInt int, location string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" @@ -838,35 +829,17 @@ resource "azurerm_subnet" "test" { address_prefix = "10.0.2.0/24" } -resource "azurerm_storage_account" "test" { - name = "accsa%s" - resource_group_name = "${azurerm_resource_group.test.name}" - location = "${azurerm_resource_group.test.location}" - account_tier = "Standard" - account_replication_type = "LRS" - - tags { - environment = "staging" - } -} - -resource "azurerm_storage_container" "test" { - name = "vhds" - resource_group_name = "${azurerm_resource_group.test.name}" - storage_account_name = "${azurerm_storage_account.test.name}" - container_access_type = "private" -} - resource "azurerm_virtual_machine_scale_set" "test" { - name = "acctvmss-%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" - upgrade_policy_mode = "Manual" + name = "acctvmss-%d" + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" + upgrade_policy_mode = "Automatic" + single_placement_group = "false" sku { - name = "Standard_F2" + name = "Standard_DS1_v2" tier = "Standard" - capacity = 2 + capacity = 30 } os_profile { @@ -887,10 +860,10 @@ resource "azurerm_virtual_machine_scale_set" "test" { } storage_profile_os_disk { - name = "osDiskProfile" - caching = "ReadWrite" - create_option = "FromImage" - vhd_containers = ["${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}"] + name = "" + caching = "ReadWrite" + create_option = "FromImage" + managed_disk_type = "StandardSSD_LRS" } storage_profile_image_reference { @@ -900,5 +873,5 @@ resource "azurerm_virtual_machine_scale_set" "test" { version = "latest" } } -`, rInt, location, rInt, rString, rInt, rInt, rInt) +`, rInt, location, rInt, rInt, rInt, rInt) } diff --git a/azurerm/resource_arm_monitor_autoscale_setting_test.go b/azurerm/resource_arm_monitor_autoscale_setting_test.go index 705301048df00..a74e0f2f678c3 100644 --- a/azurerm/resource_arm_monitor_autoscale_setting_test.go +++ b/azurerm/resource_arm_monitor_autoscale_setting_test.go @@ -14,9 +14,8 @@ import ( func TestAccAzureRMMonitorAutoScaleSetting_basic(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMMonitorAutoScaleSetting_basic(ri, rs, location) + config := testAccAzureRMMonitorAutoScaleSetting_basic(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -47,9 +46,8 @@ func TestAccAzureRMMonitorAutoScaleSetting_basic(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_multipleProfiles(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMMonitorAutoScaleSetting_multipleProfiles(ri, rs, location) + config := testAccAzureRMMonitorAutoScaleSetting_multipleProfiles(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -73,7 +71,6 @@ func TestAccAzureRMMonitorAutoScaleSetting_multipleProfiles(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_update(t *testing.T) { resourceName := "azurerm_monitor_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -82,18 +79,18 @@ func TestAccAzureRMMonitorAutoScaleSetting_update(t *testing.T) { CheckDestroy: testCheckAzureRMMonitorAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, rs, location, 1, 3, 2), + Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, location, 1, 3, 2), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), resource.TestCheckResourceAttr(resourceName, "profile.#", "1"), resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.minimum", "1"), - resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.maximum", "2"), - resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.default", "4"), + resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.maximum", "3"), + resource.TestCheckResourceAttr(resourceName, "profile.0.capacity.0.default", "2"), ), }, { - Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, rs, location, 2, 4, 3), + Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, location, 2, 4, 3), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), @@ -104,7 +101,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_update(t *testing.T) { ), }, { - Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, rs, location, 2, 45, 3), + Config: testAccAzureRMMonitorAutoScaleSetting_capacity(ri, location, 2, 45, 3), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), @@ -121,7 +118,6 @@ func TestAccAzureRMMonitorAutoScaleSetting_update(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_multipleRules(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -130,7 +126,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_multipleRules(t *testing.T) { CheckDestroy: testCheckAzureRMMonitorAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMMonitorAutoScaleSetting_basic(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_basic(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), @@ -142,7 +138,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_multipleRules(t *testing.T) { ), }, { - Config: testAccAzureRMMonitorAutoScaleSetting_multipleRules(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_multipleRules(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), @@ -170,7 +166,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_customEmails(t *testing.T) { CheckDestroy: testCheckAzureRMMonitorAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMMonitorAutoScaleSetting_email(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_email(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -180,7 +176,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_customEmails(t *testing.T) { ), }, { - Config: testAccAzureRMMonitorAutoScaleSetting_emailUpdated(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_emailUpdated(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -197,9 +193,8 @@ func TestAccAzureRMMonitorAutoScaleSetting_customEmails(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_recurrence(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMMonitorAutoScaleSetting_recurrence(ri, rs, location) + config := testAccAzureRMMonitorAutoScaleSetting_recurrence(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -229,7 +224,6 @@ func TestAccAzureRMMonitorAutoScaleSetting_recurrence(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_recurrenceUpdate(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() resource.ParallelTest(t, resource.TestCase{ @@ -238,7 +232,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_recurrenceUpdate(t *testing.T) { CheckDestroy: testCheckAzureRMMonitorAutoScaleSettingDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMMonitorAutoScaleSetting_recurrence(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_recurrence(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "notification.#", "1"), @@ -251,7 +245,7 @@ func TestAccAzureRMMonitorAutoScaleSetting_recurrenceUpdate(t *testing.T) { ), }, { - Config: testAccAzureRMMonitorAutoScaleSetting_recurrenceUpdated(ri, rs, location), + Config: testAccAzureRMMonitorAutoScaleSetting_recurrenceUpdated(ri, location), Check: resource.ComposeTestCheckFunc( testCheckAzureRMMonitorAutoScaleSettingExists(resourceName), resource.TestCheckResourceAttr(resourceName, "profile.0.recurrence.#", "1"), @@ -270,9 +264,8 @@ func TestAccAzureRMMonitorAutoScaleSetting_recurrenceUpdate(t *testing.T) { func TestAccAzureRMMonitorAutoScaleSetting_fixedDate(t *testing.T) { resourceName := "azurerm_autoscale_setting.test" ri := tf.AccRandTimeInt() - rs := acctest.RandString(6) location := testLocation() - config := testAccAzureRMMonitorAutoScaleSetting_fixedDate(ri, rs, location) + config := testAccAzureRMMonitorAutoScaleSetting_fixedDate(ri, location) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -354,8 +347,8 @@ func testCheckAzureRMMonitorAutoScaleSettingDestroy(s *terraform.State) error { return nil } -func testAccAzureRMMonitorAutoScaleSetting_basic(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_basic(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -398,8 +391,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_multipleProfiles(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_multipleProfiles(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -485,12 +478,12 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_capacity(rInt int, rString string, location string, min int, max int, defaultVal int) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_capacity(rInt int, location string, min int, max int, defaultVal int) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s -resource "azurerm_autoscale_setting" "test" { +resource "azurerm_monitor_autoscale_setting" "test" { name = "acctestautoscale-%d" resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" @@ -530,12 +523,12 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, defaultVal, min, max) } -func testAccAzureRMMonitorAutoScaleSetting_multipleRules(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_multipleRules(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s -resource "azurerm_monitor_autoscale_setting" "test" { +resource "azurerm_autoscale_setting" "test" { name = "acctestautoscale-%d" resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" @@ -595,8 +588,8 @@ resource "azurerm_monitor_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_email(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_email(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -647,8 +640,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_emailUpdated(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_emailUpdated(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -699,8 +692,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt, rInt, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_recurrence(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_recurrence(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -743,8 +736,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_recurrenceUpdated(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_recurrenceUpdated(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -787,8 +780,8 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_fixedDate(rInt int, rString string, location string) string { - template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, rString, location) +func testAccAzureRMMonitorAutoScaleSetting_fixedDate(rInt int, location string) string { + template := testAccAzureRMMonitorAutoScaleSetting_template(rInt, location) return fmt.Sprintf(` %s @@ -817,7 +810,7 @@ resource "azurerm_autoscale_setting" "test" { `, template, rInt) } -func testAccAzureRMMonitorAutoScaleSetting_template(rInt int, rString string, location string) string { +func testAccAzureRMMonitorAutoScaleSetting_template(rInt int, location string) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" @@ -838,25 +831,6 @@ resource "azurerm_subnet" "test" { address_prefix = "10.0.2.0/24" } -resource "azurerm_storage_account" "test" { - name = "accsa%s" - resource_group_name = "${azurerm_resource_group.test.name}" - location = "${azurerm_resource_group.test.location}" - account_tier = "Standard" - account_replication_type = "LRS" - - tags { - environment = "staging" - } -} - -resource "azurerm_storage_container" "test" { - name = "vhds" - resource_group_name = "${azurerm_resource_group.test.name}" - storage_account_name = "${azurerm_storage_account.test.name}" - container_access_type = "private" -} - resource "azurerm_virtual_machine_scale_set" "test" { name = "acctvmss-%d" location = "${azurerm_resource_group.test.location}" @@ -887,10 +861,10 @@ resource "azurerm_virtual_machine_scale_set" "test" { } storage_profile_os_disk { - name = "osDiskProfile" - caching = "ReadWrite" - create_option = "FromImage" - vhd_containers = ["${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}"] + name = "" + caching = "ReadWrite" + create_option = "FromImage" + managed_disk_type = "StandardSSD_LRS" } storage_profile_image_reference { @@ -900,5 +874,5 @@ resource "azurerm_virtual_machine_scale_set" "test" { version = "latest" } } -`, rInt, location, rInt, rString, rInt, rInt, rInt) +`, rInt, location, rInt, rInt, rInt, rInt) }