getAvailabilitySet

Use this data source to access information about an existing Availability Set.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Compute.GetAvailabilitySet.Invoke(new()
    {
        Name = "tf-appsecuritygroup",
        ResourceGroupName = "my-resource-group",
    });

    return new Dictionary<string, object?>
    {
        ["availabilitySetId"] = example.Apply(getAvailabilitySetResult => getAvailabilitySetResult.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := compute.LookupAvailabilitySet(ctx, &compute.LookupAvailabilitySetArgs{
			Name:              "tf-appsecuritygroup",
			ResourceGroupName: "my-resource-group",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("availabilitySetId", example.Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetAvailabilitySetArgs;
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) {
        final var example = ComputeFunctions.getAvailabilitySet(GetAvailabilitySetArgs.builder()
            .name("tf-appsecuritygroup")
            .resourceGroupName("my-resource-group")
            .build());

        ctx.export("availabilitySetId", example.applyValue(getAvailabilitySetResult -> getAvailabilitySetResult.id()));
    }
}
import pulumi
import pulumi_azure as azure

example = azure.compute.get_availability_set(name="tf-appsecuritygroup",
    resource_group_name="my-resource-group")
pulumi.export("availabilitySetId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.compute.getAvailabilitySet({
    name: "tf-appsecuritygroup",
    resourceGroupName: "my-resource-group",
});
export const availabilitySetId = example.then(example => example.id);
variables:
  example:
    Fn::Invoke:
      Function: azure:compute:getAvailabilitySet
      Arguments:
        name: tf-appsecuritygroup
        resourceGroupName: my-resource-group
outputs:
  availabilitySetId: ${example.id}

Using getAvailabilitySet

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAvailabilitySet(args: GetAvailabilitySetArgs, opts?: InvokeOptions): Promise<GetAvailabilitySetResult>
function getAvailabilitySetOutput(args: GetAvailabilitySetOutputArgs, opts?: InvokeOptions): Output<GetAvailabilitySetResult>
def get_availability_set(name: Optional[str] = None,
                         resource_group_name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetAvailabilitySetResult
def get_availability_set_output(name: Optional[pulumi.Input[str]] = None,
                         resource_group_name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetAvailabilitySetResult]
func LookupAvailabilitySet(ctx *Context, args *LookupAvailabilitySetArgs, opts ...InvokeOption) (*LookupAvailabilitySetResult, error)
func LookupAvailabilitySetOutput(ctx *Context, args *LookupAvailabilitySetOutputArgs, opts ...InvokeOption) LookupAvailabilitySetResultOutput

> Note: This function is named LookupAvailabilitySet in the Go SDK.

public static class GetAvailabilitySet 
{
    public static Task<GetAvailabilitySetResult> InvokeAsync(GetAvailabilitySetArgs args, InvokeOptions? opts = null)
    public static Output<GetAvailabilitySetResult> Invoke(GetAvailabilitySetInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAvailabilitySetResult> getAvailabilitySet(GetAvailabilitySetArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azure:compute/getAvailabilitySet:getAvailabilitySet
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of the Availability Set.

ResourceGroupName string

The name of the resource group in which the Availability Set exists.

Name string

The name of the Availability Set.

ResourceGroupName string

The name of the resource group in which the Availability Set exists.

name String

The name of the Availability Set.

resourceGroupName String

The name of the resource group in which the Availability Set exists.

name string

The name of the Availability Set.

resourceGroupName string

The name of the resource group in which the Availability Set exists.

name str

The name of the Availability Set.

resource_group_name str

The name of the resource group in which the Availability Set exists.

name String

The name of the Availability Set.

resourceGroupName String

The name of the resource group in which the Availability Set exists.

getAvailabilitySet Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Location string

The supported Azure location where the Availability Set exists.

Managed bool

Whether the availability set is managed or not.

Name string
PlatformFaultDomainCount string

The number of fault domains that are used.

PlatformUpdateDomainCount string

The number of update domains that are used.

ResourceGroupName string
Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The supported Azure location where the Availability Set exists.

Managed bool

Whether the availability set is managed or not.

Name string
PlatformFaultDomainCount string

The number of fault domains that are used.

PlatformUpdateDomainCount string

The number of update domains that are used.

ResourceGroupName string
Tags map[string]string

A mapping of tags assigned to the resource.

id String

The provider-assigned unique ID for this managed resource.

location String

The supported Azure location where the Availability Set exists.

managed Boolean

Whether the availability set is managed or not.

name String
platformFaultDomainCount String

The number of fault domains that are used.

platformUpdateDomainCount String

The number of update domains that are used.

resourceGroupName String
tags Map<String,String>

A mapping of tags assigned to the resource.

id string

The provider-assigned unique ID for this managed resource.

location string

The supported Azure location where the Availability Set exists.

managed boolean

Whether the availability set is managed or not.

name string
platformFaultDomainCount string

The number of fault domains that are used.

platformUpdateDomainCount string

The number of update domains that are used.

resourceGroupName string
tags {[key: string]: string}

A mapping of tags assigned to the resource.

id str

The provider-assigned unique ID for this managed resource.

location str

The supported Azure location where the Availability Set exists.

managed bool

Whether the availability set is managed or not.

name str
platform_fault_domain_count str

The number of fault domains that are used.

platform_update_domain_count str

The number of update domains that are used.

resource_group_name str
tags Mapping[str, str]

A mapping of tags assigned to the resource.

id String

The provider-assigned unique ID for this managed resource.

location String

The supported Azure location where the Availability Set exists.

managed Boolean

Whether the availability set is managed or not.

name String
platformFaultDomainCount String

The number of fault domains that are used.

platformUpdateDomainCount String

The number of update domains that are used.

resourceGroupName String
tags Map<String>

A mapping of tags assigned to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.