1. Packages
  2. Azure Classic
  3. API Docs
  4. digitaltwins
  5. getInstance

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.digitaltwins.getInstance

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Use this data source to access information about an existing Digital Twins instance.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.digitaltwins.getInstance({
        name: "existing-digital-twins",
        resourceGroupName: "existing-resgroup",
    });
    export const id = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.digitaltwins.get_instance(name="existing-digital-twins",
        resource_group_name="existing-resgroup")
    pulumi.export("id", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/digitaltwins"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := digitaltwins.LookupInstance(ctx, &digitaltwins.LookupInstanceArgs{
    			Name:              "existing-digital-twins",
    			ResourceGroupName: "existing-resgroup",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.DigitalTwins.GetInstance.Invoke(new()
        {
            Name = "existing-digital-twins",
            ResourceGroupName = "existing-resgroup",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = example.Apply(getInstanceResult => getInstanceResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.digitaltwins.DigitaltwinsFunctions;
    import com.pulumi.azure.digitaltwins.inputs.GetInstanceArgs;
    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 = DigitaltwinsFunctions.getInstance(GetInstanceArgs.builder()
                .name("existing-digital-twins")
                .resourceGroupName("existing-resgroup")
                .build());
    
            ctx.export("id", example.applyValue(getInstanceResult -> getInstanceResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:digitaltwins:getInstance
          Arguments:
            name: existing-digital-twins
            resourceGroupName: existing-resgroup
    outputs:
      id: ${example.id}
    

    Using getInstance

    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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
    function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
    def get_instance(name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetInstanceResult
    def get_instance_output(name: Optional[pulumi.Input[str]] = None,
                     resource_group_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
    func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
    func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

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

    public static class GetInstance 
    {
        public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:digitaltwins/getInstance:getInstance
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of this Digital Twins instance.
    ResourceGroupName string
    The name of the Resource Group where the Digital Twins instance exists.
    Name string
    The name of this Digital Twins instance.
    ResourceGroupName string
    The name of the Resource Group where the Digital Twins instance exists.
    name String
    The name of this Digital Twins instance.
    resourceGroupName String
    The name of the Resource Group where the Digital Twins instance exists.
    name string
    The name of this Digital Twins instance.
    resourceGroupName string
    The name of the Resource Group where the Digital Twins instance exists.
    name str
    The name of this Digital Twins instance.
    resource_group_name str
    The name of the Resource Group where the Digital Twins instance exists.
    name String
    The name of this Digital Twins instance.
    resourceGroupName String
    The name of the Resource Group where the Digital Twins instance exists.

    getInstance Result

    The following output properties are available:

    HostName string
    The API endpoint to work with this Digital Twins instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region where the Digital Twins instance exists.
    Name string
    ResourceGroupName string
    Tags Dictionary<string, string>
    A mapping of tags assigned to the Digital Twins instance.
    HostName string
    The API endpoint to work with this Digital Twins instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region where the Digital Twins instance exists.
    Name string
    ResourceGroupName string
    Tags map[string]string
    A mapping of tags assigned to the Digital Twins instance.
    hostName String
    The API endpoint to work with this Digital Twins instance.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region where the Digital Twins instance exists.
    name String
    resourceGroupName String
    tags Map<String,String>
    A mapping of tags assigned to the Digital Twins instance.
    hostName string
    The API endpoint to work with this Digital Twins instance.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The Azure Region where the Digital Twins instance exists.
    name string
    resourceGroupName string
    tags {[key: string]: string}
    A mapping of tags assigned to the Digital Twins instance.
    host_name str
    The API endpoint to work with this Digital Twins instance.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The Azure Region where the Digital Twins instance exists.
    name str
    resource_group_name str
    tags Mapping[str, str]
    A mapping of tags assigned to the Digital Twins instance.
    hostName String
    The API endpoint to work with this Digital Twins instance.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region where the Digital Twins instance exists.
    name String
    resourceGroupName String
    tags Map<String>
    A mapping of tags assigned to the Digital Twins instance.

    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.10.0 published on Tuesday, Nov 19, 2024 by Pulumi