We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
azure.compute.getAvailabilitySet
Explore with Pulumi AI
Use this data source to access information about an existing Availability Set.
Example Usage
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);
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)
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
})
}
using System.Collections.Generic;
using System.Linq;
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 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()));
}
}
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.
- Resource
Group stringName - The name of the resource group in which the Availability Set exists.
- Name string
- The name of the Availability Set.
- Resource
Group stringName - The name of the resource group in which the Availability Set exists.
- name String
- The name of the Availability Set.
- resource
Group StringName - The name of the resource group in which the Availability Set exists.
- name string
- The name of the Availability Set.
- resource
Group stringName - The name of the resource group in which the Availability Set exists.
- name str
- The name of the Availability Set.
- resource_
group_ strname - The name of the resource group in which the Availability Set exists.
- name String
- The name of the Availability Set.
- resource
Group StringName - 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
- Platform
Fault stringDomain Count - The number of fault domains that are used.
- Platform
Update stringDomain Count - The number of update domains that are used.
- Resource
Group stringName - 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
- Platform
Fault stringDomain Count - The number of fault domains that are used.
- Platform
Update stringDomain Count - The number of update domains that are used.
- Resource
Group stringName - 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
- platform
Fault StringDomain Count - The number of fault domains that are used.
- platform
Update StringDomain Count - The number of update domains that are used.
- resource
Group StringName - 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
- platform
Fault stringDomain Count - The number of fault domains that are used.
- platform
Update stringDomain Count - The number of update domains that are used.
- resource
Group stringName - {[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_ strdomain_ count - The number of fault domains that are used.
- platform_
update_ strdomain_ count - The number of update domains that are used.
- resource_
group_ strname - 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
- platform
Fault StringDomain Count - The number of fault domains that are used.
- platform
Update StringDomain Count - The number of update domains that are used.
- resource
Group StringName - Map<String>
- A mapping of tags assigned to the resource.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.