Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/availability_set: flipping the default value for managed to true #5724

Merged
merged 2 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func resourceArmAvailabilitySet() *schema.Resource {
"managed": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Default: true,
ForceNew: true,
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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(),
Expand Down Expand Up @@ -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"
Expand All @@ -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)
}
16 changes: 8 additions & 8 deletions website/docs/r/availability_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand Down