2016-01-07 02:27:24 +01:00
---
layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_availability_set"
2016-01-10 02:09:14 +01:00
sidebar_current: "docs-azurerm-resource-virtualmachine-availability-set"
2016-01-07 02:27:24 +01:00
description: |-
Create an availability set for virtual machines.
---
# azurerm\_availability\_set
Create an availability set for virtual machines.
## Example Usage
2017-04-17 12:17:54 +02:00
```hcl
2016-01-07 02:27:24 +01:00
resource "azurerm_resource_group" "test" {
2017-02-18 23:48:50 +01:00
name = "resourceGroup1"
location = "West US"
2016-01-07 02:27:24 +01:00
}
resource "azurerm_availability_set" "test" {
2017-02-18 23:48:50 +01:00
name = "acceptanceTestAvailabilitySet1"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
tags {
environment = "Production"
}
2016-01-07 02:27:24 +01:00
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) Specifies the name of the availability set. Changing this forces a
new resource to be created.
* `resource_group_name` - (Required) The name of the resource group in which to
create the availability set.
* `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_fault_domain_count` - (Optional) Specifies the number of fault domains that are used. Defaults to 3.
2017-03-08 20:40:58 +01:00
* `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` .
2017-02-18 23:48:50 +01:00
* `tags` - (Optional) A mapping of tags to assign to the resource.
2016-01-07 02:27:24 +01:00
## Attributes Reference
The following attributes are exported:
2016-07-19 18:22:30 +02:00
* `id` - The virtual AvailabilitySet ID.
## Import
2017-02-18 23:48:50 +01:00
Availability Sets can be imported using the `resource id` , e.g.
2016-07-19 18:22:30 +02:00
```
terraform import azurerm_availability_set.group1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/availabilitySets/webAvailSet
```