diff --git a/azurerm/internal/services/compute/resource_arm_availability_set.go b/azurerm/internal/services/compute/resource_arm_availability_set.go index e570c83b5a53..40ed7cf9e085 100644 --- a/azurerm/internal/services/compute/resource_arm_availability_set.go +++ b/azurerm/internal/services/compute/resource_arm_availability_set.go @@ -66,7 +66,7 @@ func resourceArmAvailabilitySet() *schema.Resource { "managed": { Type: schema.TypeBool, Optional: true, - Default: false, + Default: true, ForceNew: true, }, diff --git a/azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go b/azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go index 9c8e9792ab55..a7400b08196e 100644 --- a/azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go +++ b/azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go @@ -157,7 +157,7 @@ func TestAccAzureRMAvailabilitySet_withDomainCounts(t *testing.T) { }) } -func TestAccAzureRMAvailabilitySet_managed(t *testing.T) { +func TestAccAzureRMAvailabilitySet_unmanaged(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_availability_set", "test") resource.ParallelTest(t, resource.TestCase{ @@ -166,10 +166,10 @@ func TestAccAzureRMAvailabilitySet_managed(t *testing.T) { CheckDestroy: testCheckAzureRMAvailabilitySetDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMAvailabilitySet_managed(data), + Config: testAccAzureRMAvailabilitySet_unmanaged(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAvailabilitySetExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "managed", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "managed", "false"), ), }, data.ImportStep(), @@ -371,7 +371,7 @@ resource "azurerm_availability_set" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } -func testAccAzureRMAvailabilitySet_managed(data acceptance.TestData) string { +func testAccAzureRMAvailabilitySet_unmanaged(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { name = "acctestRG-%d" @@ -384,7 +384,7 @@ resource "azurerm_availability_set" "test" { resource_group_name = "${azurerm_resource_group.test.name}" platform_update_domain_count = 3 platform_fault_domain_count = 3 - managed = true + managed = false } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } diff --git a/website/docs/guides/2.0-upgrade-guide.html.markdown b/website/docs/guides/2.0-upgrade-guide.html.markdown index 5b3d7ed7fa4e..eac86df43f7d 100644 --- a/website/docs/guides/2.0-upgrade-guide.html.markdown +++ b/website/docs/guides/2.0-upgrade-guide.html.markdown @@ -217,6 +217,10 @@ The deprecated `account_name` field will be removed. This has been deprecated in The deprecated `account_name` field will be removed. This has been deprecated in favour of the `automation_account_name` field. +### Resource: `azurerm_availability_set` + +The default value for the field `managed` has changed from `false` to `true`. + ### Resource: `azurerm_azuread_application` The AzureAD Data Sources and Resources have been moved to [the new AzureAD Provider](https://www.terraform.io/docs/providers/azuread/index.html), as such this Resource will be removed in v2.0 of the AzureRM Provider. diff --git a/website/docs/r/availability_set.html.markdown b/website/docs/r/availability_set.html.markdown index ee56fd30d99e..7bb43b4cda97 100644 --- a/website/docs/r/availability_set.html.markdown +++ b/website/docs/r/availability_set.html.markdown @@ -3,24 +3,24 @@ subcategory: "Compute" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_availability_set" description: |- - Manages an availability set for virtual machines. + Manages an Availability Set for Virtual Machines. --- # azurerm_availability_set -Manages an availability set for virtual machines. +Manages an Availability Set for Virtual Machines. ## Example Usage ```hcl resource "azurerm_resource_group" "example" { - name = "resourceGroup1" - location = "West US" + name = "example-resources" + location = "West Europe" } resource "azurerm_availability_set" "example" { - name = "acceptanceTestAvailabilitySet1" + name = "example-aset" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name @@ -40,17 +40,17 @@ The following arguments are supported: * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -* `platform_update_domain_count` - (Optional) Specifies the number of update domains that are used. Defaults to 5. +* `platform_update_domain_count` - (Optional) Specifies the number of update domains that are used. Defaults to `5`. ~> **NOTE:** The number of Update Domains varies depending on which Azure Region you're using - [a list can be found here](https://github.com/MicrosoftDocs/azure-docs/blob/master/includes/managed-disks-common-fault-domain-region-list.md). -* `platform_fault_domain_count` - (Optional) Specifies the number of fault domains that are used. Defaults to 3. +* `platform_fault_domain_count` - (Optional) Specifies the number of fault domains that are used. Defaults to `3`. ~> **NOTE:** The number of Fault Domains varies depending on which Azure Region you're using - [a list can be found here](https://github.com/MicrosoftDocs/azure-docs/blob/master/includes/managed-disks-common-fault-domain-region-list.md). * `proximity_placement_group_id` - (Optional) The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created -* `managed` - (Optional) Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `false`. +* `managed` - (Optional) Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `true`. * `tags` - (Optional) A mapping of tags to assign to the resource.