azure-native.compute.AvailabilitySet
Explore with Pulumi AI
Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Manage the availability of virtual machines.
For more information on Azure planned maintenance, see Planned maintenance for virtual machines in Azure
Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set.
API Version: 2020-12-01.
Example Usage
Create an availability set.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var availabilitySet = new AzureNative.Compute.AvailabilitySet("availabilitySet", new()
{
AvailabilitySetName = "myAvailabilitySet",
Location = "westus",
PlatformFaultDomainCount = 2,
PlatformUpdateDomainCount = 20,
ResourceGroupName = "myResourceGroup",
});
});
package main
import (
compute "github.com/pulumi/pulumi-azure-native-sdk/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewAvailabilitySet(ctx, "availabilitySet", &compute.AvailabilitySetArgs{
AvailabilitySetName: pulumi.String("myAvailabilitySet"),
Location: pulumi.String("westus"),
PlatformFaultDomainCount: pulumi.Int(2),
PlatformUpdateDomainCount: pulumi.Int(20),
ResourceGroupName: pulumi.String("myResourceGroup"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.AvailabilitySet;
import com.pulumi.azurenative.compute.AvailabilitySetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var availabilitySet = new AvailabilitySet("availabilitySet", AvailabilitySetArgs.builder()
.availabilitySetName("myAvailabilitySet")
.location("westus")
.platformFaultDomainCount(2)
.platformUpdateDomainCount(20)
.resourceGroupName("myResourceGroup")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
availability_set = azure_native.compute.AvailabilitySet("availabilitySet",
availability_set_name="myAvailabilitySet",
location="westus",
platform_fault_domain_count=2,
platform_update_domain_count=20,
resource_group_name="myResourceGroup")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const availabilitySet = new azure_native.compute.AvailabilitySet("availabilitySet", {
availabilitySetName: "myAvailabilitySet",
location: "westus",
platformFaultDomainCount: 2,
platformUpdateDomainCount: 20,
resourceGroupName: "myResourceGroup",
});
resources:
availabilitySet:
type: azure-native:compute:AvailabilitySet
properties:
availabilitySetName: myAvailabilitySet
location: westus
platformFaultDomainCount: 2
platformUpdateDomainCount: 20
resourceGroupName: myResourceGroup
Create AvailabilitySet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AvailabilitySet(name: string, args: AvailabilitySetArgs, opts?: CustomResourceOptions);
@overload
def AvailabilitySet(resource_name: str,
args: AvailabilitySetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AvailabilitySet(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
availability_set_name: Optional[str] = None,
location: Optional[str] = None,
platform_fault_domain_count: Optional[int] = None,
platform_update_domain_count: Optional[int] = None,
proximity_placement_group: Optional[SubResourceArgs] = None,
sku: Optional[SkuArgs] = None,
tags: Optional[Mapping[str, str]] = None,
virtual_machines: Optional[Sequence[SubResourceArgs]] = None)
func NewAvailabilitySet(ctx *Context, name string, args AvailabilitySetArgs, opts ...ResourceOption) (*AvailabilitySet, error)
public AvailabilitySet(string name, AvailabilitySetArgs args, CustomResourceOptions? opts = null)
public AvailabilitySet(String name, AvailabilitySetArgs args)
public AvailabilitySet(String name, AvailabilitySetArgs args, CustomResourceOptions options)
type: azure-native:compute:AvailabilitySet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AvailabilitySetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AvailabilitySetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AvailabilitySetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AvailabilitySetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AvailabilitySetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var availabilitySetResource = new AzureNative.Compute.AvailabilitySet("availabilitySetResource", new()
{
ResourceGroupName = "string",
AvailabilitySetName = "string",
Location = "string",
PlatformFaultDomainCount = 0,
PlatformUpdateDomainCount = 0,
ProximityPlacementGroup =
{
{ "id", "string" },
},
Sku =
{
{ "capacity", 0 },
{ "name", "string" },
{ "tier", "string" },
},
Tags =
{
{ "string", "string" },
},
VirtualMachines = new[]
{
{
{ "id", "string" },
},
},
});
example, err := compute.NewAvailabilitySet(ctx, "availabilitySetResource", &compute.AvailabilitySetArgs{
ResourceGroupName: "string",
AvailabilitySetName: "string",
Location: "string",
PlatformFaultDomainCount: 0,
PlatformUpdateDomainCount: 0,
ProximityPlacementGroup: map[string]interface{}{
"id": "string",
},
Sku: map[string]interface{}{
"capacity": 0,
"name": "string",
"tier": "string",
},
Tags: map[string]interface{}{
"string": "string",
},
VirtualMachines: []map[string]interface{}{
map[string]interface{}{
"id": "string",
},
},
})
var availabilitySetResource = new AvailabilitySet("availabilitySetResource", AvailabilitySetArgs.builder()
.resourceGroupName("string")
.availabilitySetName("string")
.location("string")
.platformFaultDomainCount(0)
.platformUpdateDomainCount(0)
.proximityPlacementGroup(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.sku(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.virtualMachines(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
availability_set_resource = azure_native.compute.AvailabilitySet("availabilitySetResource",
resource_group_name=string,
availability_set_name=string,
location=string,
platform_fault_domain_count=0,
platform_update_domain_count=0,
proximity_placement_group={
id: string,
},
sku={
capacity: 0,
name: string,
tier: string,
},
tags={
string: string,
},
virtual_machines=[{
id: string,
}])
const availabilitySetResource = new azure_native.compute.AvailabilitySet("availabilitySetResource", {
resourceGroupName: "string",
availabilitySetName: "string",
location: "string",
platformFaultDomainCount: 0,
platformUpdateDomainCount: 0,
proximityPlacementGroup: {
id: "string",
},
sku: {
capacity: 0,
name: "string",
tier: "string",
},
tags: {
string: "string",
},
virtualMachines: [{
id: "string",
}],
});
type: azure-native:compute:AvailabilitySet
properties:
availabilitySetName: string
location: string
platformFaultDomainCount: 0
platformUpdateDomainCount: 0
proximityPlacementGroup:
id: string
resourceGroupName: string
sku:
capacity: 0
name: string
tier: string
tags:
string: string
virtualMachines:
- id: string
AvailabilitySet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The AvailabilitySet resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group.
- Availability
Set stringName - The name of the availability set.
- Location string
- Resource location
- Platform
Fault intDomain Count - Fault Domain count.
- Platform
Update intDomain Count - Update Domain count.
- Proximity
Placement Pulumi.Group Azure Native. Compute. Inputs. Sub Resource - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- Sku
Pulumi.
Azure Native. Compute. Inputs. Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- Dictionary<string, string>
- Resource tags
- Virtual
Machines List<Pulumi.Azure Native. Compute. Inputs. Sub Resource> - A list of references to all virtual machines in the availability set.
- Resource
Group stringName - The name of the resource group.
- Availability
Set stringName - The name of the availability set.
- Location string
- Resource location
- Platform
Fault intDomain Count - Fault Domain count.
- Platform
Update intDomain Count - Update Domain count.
- Proximity
Placement SubGroup Resource Args - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- Sku
Sku
Args - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- map[string]string
- Resource tags
- Virtual
Machines []SubResource Args - A list of references to all virtual machines in the availability set.
- resource
Group StringName - The name of the resource group.
- availability
Set StringName - The name of the availability set.
- location String
- Resource location
- platform
Fault IntegerDomain Count - Fault Domain count.
- platform
Update IntegerDomain Count - Update Domain count.
- proximity
Placement SubGroup Resource - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- sku Sku
- Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- Map<String,String>
- Resource tags
- virtual
Machines List<SubResource> - A list of references to all virtual machines in the availability set.
- resource
Group stringName - The name of the resource group.
- availability
Set stringName - The name of the availability set.
- location string
- Resource location
- platform
Fault numberDomain Count - Fault Domain count.
- platform
Update numberDomain Count - Update Domain count.
- proximity
Placement SubGroup Resource - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- sku Sku
- Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- {[key: string]: string}
- Resource tags
- virtual
Machines SubResource[] - A list of references to all virtual machines in the availability set.
- resource_
group_ strname - The name of the resource group.
- availability_
set_ strname - The name of the availability set.
- location str
- Resource location
- platform_
fault_ intdomain_ count - Fault Domain count.
- platform_
update_ intdomain_ count - Update Domain count.
- proximity_
placement_ Subgroup Resource Args - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- sku
Sku
Args - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- Mapping[str, str]
- Resource tags
- virtual_
machines Sequence[SubResource Args] - A list of references to all virtual machines in the availability set.
- resource
Group StringName - The name of the resource group.
- availability
Set StringName - The name of the availability set.
- location String
- Resource location
- platform
Fault NumberDomain Count - Fault Domain count.
- platform
Update NumberDomain Count - Update Domain count.
- proximity
Placement Property MapGroup - Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01.
- sku Property Map
- Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
- Map<String>
- Resource tags
- virtual
Machines List<Property Map> - A list of references to all virtual machines in the availability set.
Outputs
All input properties are implicitly available as output properties. Additionally, the AvailabilitySet resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name
- Statuses
List<Pulumi.
Azure Native. Compute. Outputs. Instance View Status Response> - The resource status information.
- Type string
- Resource type
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name
- Statuses
[]Instance
View Status Response - The resource status information.
- Type string
- Resource type
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name
- statuses
List<Instance
View Status Response> - The resource status information.
- type String
- Resource type
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Resource name
- statuses
Instance
View Status Response[] - The resource status information.
- type string
- Resource type
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Resource name
- statuses
Sequence[Instance
View Status Response] - The resource status information.
- type str
- Resource type
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name
- statuses List<Property Map>
- The resource status information.
- type String
- Resource type
Supporting Types
InstanceViewStatusResponse, InstanceViewStatusResponseArgs
- Code string
- The status code.
- Display
Status string - The short localizable label for the status.
- Level string
- The level code.
- Message string
- The detailed status message, including for alerts and error messages.
- Time string
- The time of the status.
- Code string
- The status code.
- Display
Status string - The short localizable label for the status.
- Level string
- The level code.
- Message string
- The detailed status message, including for alerts and error messages.
- Time string
- The time of the status.
- code String
- The status code.
- display
Status String - The short localizable label for the status.
- level String
- The level code.
- message String
- The detailed status message, including for alerts and error messages.
- time String
- The time of the status.
- code string
- The status code.
- display
Status string - The short localizable label for the status.
- level string
- The level code.
- message string
- The detailed status message, including for alerts and error messages.
- time string
- The time of the status.
- code str
- The status code.
- display_
status str - The short localizable label for the status.
- level str
- The level code.
- message str
- The detailed status message, including for alerts and error messages.
- time str
- The time of the status.
- code String
- The status code.
- display
Status String - The short localizable label for the status.
- level String
- The level code.
- message String
- The detailed status message, including for alerts and error messages.
- time String
- The time of the status.
Sku, SkuArgs
SkuResponse, SkuResponseArgs
SubResource, SubResourceArgs
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id str
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
SubResourceResponse, SubResourceResponseArgs
- Id string
- Resource Id
- Id string
- Resource Id
- id String
- Resource Id
- id string
- Resource Id
- id str
- Resource Id
- id String
- Resource Id
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:compute:AvailabilitySet myAvailabilitySet /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0