1. Packages
  2. Azure Classic
  3. API Docs
  4. extendedlocation
  5. getCustomLocation

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.extendedlocation.getCustomLocation

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

    Use this data source to access information about an existing Custom Location within an Extended Location.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.extendedlocation.getCustomLocation({
        name: exampleAzurermExtendedLocationCustomLocation.name,
        resourceGroupName: exampleAzurermResourceGroup.name,
    });
    export const customLocationId = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.extendedlocation.get_custom_location(name=example_azurerm_extended_location_custom_location["name"],
        resource_group_name=example_azurerm_resource_group["name"])
    pulumi.export("customLocationId", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/extendedlocation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := extendedlocation.LookupCustomLocation(ctx, &extendedlocation.LookupCustomLocationArgs{
    			Name:              exampleAzurermExtendedLocationCustomLocation.Name,
    			ResourceGroupName: exampleAzurermResourceGroup.Name,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("customLocationId", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.ExtendedLocation.GetCustomLocation.Invoke(new()
        {
            Name = exampleAzurermExtendedLocationCustomLocation.Name,
            ResourceGroupName = exampleAzurermResourceGroup.Name,
        });
    
        return new Dictionary<string, object?>
        {
            ["customLocationId"] = example.Apply(getCustomLocationResult => getCustomLocationResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.extendedlocation.ExtendedlocationFunctions;
    import com.pulumi.azure.extendedlocation.inputs.GetCustomLocationArgs;
    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 = ExtendedlocationFunctions.getCustomLocation(GetCustomLocationArgs.builder()
                .name(exampleAzurermExtendedLocationCustomLocation.name())
                .resourceGroupName(exampleAzurermResourceGroup.name())
                .build());
    
            ctx.export("customLocationId", example.applyValue(getCustomLocationResult -> getCustomLocationResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: azure:extendedlocation:getCustomLocation
          arguments:
            name: ${exampleAzurermExtendedLocationCustomLocation.name}
            resourceGroupName: ${exampleAzurermResourceGroup.name}
    outputs:
      customLocationId: ${example.id}
    

    Using getCustomLocation

    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 getCustomLocation(args: GetCustomLocationArgs, opts?: InvokeOptions): Promise<GetCustomLocationResult>
    function getCustomLocationOutput(args: GetCustomLocationOutputArgs, opts?: InvokeOptions): Output<GetCustomLocationResult>
    def get_custom_location(name: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetCustomLocationResult
    def get_custom_location_output(name: Optional[pulumi.Input[str]] = None,
                            resource_group_name: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetCustomLocationResult]
    func LookupCustomLocation(ctx *Context, args *LookupCustomLocationArgs, opts ...InvokeOption) (*LookupCustomLocationResult, error)
    func LookupCustomLocationOutput(ctx *Context, args *LookupCustomLocationOutputArgs, opts ...InvokeOption) LookupCustomLocationResultOutput

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

    public static class GetCustomLocation 
    {
        public static Task<GetCustomLocationResult> InvokeAsync(GetCustomLocationArgs args, InvokeOptions? opts = null)
        public static Output<GetCustomLocationResult> Invoke(GetCustomLocationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCustomLocationResult> getCustomLocation(GetCustomLocationArgs args, InvokeOptions options)
    public static Output<GetCustomLocationResult> getCustomLocation(GetCustomLocationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:extendedlocation/getCustomLocation:getCustomLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Custom Location.
    ResourceGroupName string
    The name of the Resource Group where the Custom Location exists.
    Name string
    The name of the Custom Location.
    ResourceGroupName string
    The name of the Resource Group where the Custom Location exists.
    name String
    The name of the Custom Location.
    resourceGroupName String
    The name of the Resource Group where the Custom Location exists.
    name string
    The name of the Custom Location.
    resourceGroupName string
    The name of the Resource Group where the Custom Location exists.
    name str
    The name of the Custom Location.
    resource_group_name str
    The name of the Resource Group where the Custom Location exists.
    name String
    The name of the Custom Location.
    resourceGroupName String
    The name of the Resource Group where the Custom Location exists.

    getCustomLocation Result

    The following output properties are available:

    Authentications List<GetCustomLocationAuthentication>
    An authentication block as defined below.
    ClusterExtensionIds List<string>
    The list of Cluster Extension IDs.
    DisplayName string
    The display name of the Custom Location.
    HostResourceId string
    The host resource ID.
    HostType string
    The host type of the Custom Location.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure location where the Custom Location exists.
    Name string
    Namespace string
    The namespace of the Custom Location.
    ResourceGroupName string
    Authentications []GetCustomLocationAuthentication
    An authentication block as defined below.
    ClusterExtensionIds []string
    The list of Cluster Extension IDs.
    DisplayName string
    The display name of the Custom Location.
    HostResourceId string
    The host resource ID.
    HostType string
    The host type of the Custom Location.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure location where the Custom Location exists.
    Name string
    Namespace string
    The namespace of the Custom Location.
    ResourceGroupName string
    authentications List<GetCustomLocationAuthentication>
    An authentication block as defined below.
    clusterExtensionIds List<String>
    The list of Cluster Extension IDs.
    displayName String
    The display name of the Custom Location.
    hostResourceId String
    The host resource ID.
    hostType String
    The host type of the Custom Location.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure location where the Custom Location exists.
    name String
    namespace String
    The namespace of the Custom Location.
    resourceGroupName String
    authentications GetCustomLocationAuthentication[]
    An authentication block as defined below.
    clusterExtensionIds string[]
    The list of Cluster Extension IDs.
    displayName string
    The display name of the Custom Location.
    hostResourceId string
    The host resource ID.
    hostType string
    The host type of the Custom Location.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The Azure location where the Custom Location exists.
    name string
    namespace string
    The namespace of the Custom Location.
    resourceGroupName string
    authentications Sequence[GetCustomLocationAuthentication]
    An authentication block as defined below.
    cluster_extension_ids Sequence[str]
    The list of Cluster Extension IDs.
    display_name str
    The display name of the Custom Location.
    host_resource_id str
    The host resource ID.
    host_type str
    The host type of the Custom Location.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The Azure location where the Custom Location exists.
    name str
    namespace str
    The namespace of the Custom Location.
    resource_group_name str
    authentications List<Property Map>
    An authentication block as defined below.
    clusterExtensionIds List<String>
    The list of Cluster Extension IDs.
    displayName String
    The display name of the Custom Location.
    hostResourceId String
    The host resource ID.
    hostType String
    The host type of the Custom Location.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure location where the Custom Location exists.
    name String
    namespace String
    The namespace of the Custom Location.
    resourceGroupName String

    Supporting Types

    GetCustomLocationAuthentication

    Type string
    The type of authentication.
    Value string
    The value of authentication.
    Type string
    The type of authentication.
    Value string
    The value of authentication.
    type String
    The type of authentication.
    value String
    The value of authentication.
    type string
    The type of authentication.
    value string
    The value of authentication.
    type str
    The type of authentication.
    value str
    The value of authentication.
    type String
    The type of authentication.
    value String
    The value of authentication.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi