1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ots
  5. getInstances
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

alicloud.ots.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

    This data source provides the ots instances of the current Alibaba Cloud user.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            NameRegex = "sample-instance",
            OutputFile = "instances.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstInstanceId"] = instancesDs.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		instancesDs, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			NameRegex:  pulumi.StringRef("sample-instance"),
    			OutputFile: pulumi.StringRef("instances.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstInstanceId", instancesDs.Instances[0].Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .nameRegex("sample-instance")
                .outputFile("instances.txt")
                .build());
    
            ctx.export("firstInstanceId", instancesDs.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(name_regex="sample-instance",
        output_file="instances.txt")
    pulumi.export("firstInstanceId", instances_ds.instances[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const instancesDs = alicloud.ots.getInstances({
        nameRegex: "sample-instance",
        outputFile: "instances.txt",
    });
    export const firstInstanceId = instancesDs.then(instancesDs => instancesDs.instances?.[0]?.id);
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            nameRegex: sample-instance
            outputFile: instances.txt
    outputs:
      firstInstanceId: ${instancesDs.instances[0].id}
    

    Using getInstances

    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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
    function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
    def get_instances(ids: Optional[Sequence[str]] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      tags: Optional[Mapping[str, Any]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetInstancesResult
    def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
    func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
    func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

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

    public static class GetInstances 
    {
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ots/getInstances:getInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of instance IDs.
    NameRegex string
    A regex string to filter results by instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Tags Dictionary<string, object>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    Ids []string
    A list of instance IDs.
    NameRegex string
    A regex string to filter results by instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Tags map[string]interface{}
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    ids List<String>
    A list of instance IDs.
    nameRegex String
    A regex string to filter results by instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    tags Map<String,Object>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    ids string[]
    A list of instance IDs.
    nameRegex string
    A regex string to filter results by instance name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    tags {[key: string]: any}
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    ids Sequence[str]
    A list of instance IDs.
    name_regex str
    A regex string to filter results by instance name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    tags Mapping[str, Any]
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    ids List<String>
    A list of instance IDs.
    nameRegex String
    A regex string to filter results by instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    tags Map<Any>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    

    getInstances Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of instance IDs.
    Instances List<Pulumi.AliCloud.Ots.Outputs.GetInstancesInstance>
    A list of instances. Each element contains the following attributes:
    Names List<string>
    A list of instance names.
    NameRegex string
    OutputFile string
    Tags Dictionary<string, object>
    The tags of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of instance IDs.
    Instances []GetInstancesInstance
    A list of instances. Each element contains the following attributes:
    Names []string
    A list of instance names.
    NameRegex string
    OutputFile string
    Tags map[string]interface{}
    The tags of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of instance IDs.
    instances List<GetInstancesInstance>
    A list of instances. Each element contains the following attributes:
    names List<String>
    A list of instance names.
    nameRegex String
    outputFile String
    tags Map<String,Object>
    The tags of the instance.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of instance IDs.
    instances GetInstancesInstance[]
    A list of instances. Each element contains the following attributes:
    names string[]
    A list of instance names.
    nameRegex string
    outputFile string
    tags {[key: string]: any}
    The tags of the instance.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of instance IDs.
    instances Sequence[GetInstancesInstance]
    A list of instances. Each element contains the following attributes:
    names Sequence[str]
    A list of instance names.
    name_regex str
    output_file str
    tags Mapping[str, Any]
    The tags of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of instance IDs.
    instances List<Property Map>
    A list of instances. Each element contains the following attributes:
    names List<String>
    A list of instance names.
    nameRegex String
    outputFile String
    tags Map<Any>
    The tags of the instance.

    Supporting Types

    GetInstancesInstance

    ClusterType string
    The cluster type of the instance. Possible values: SSD, HYBRID.
    CreateTime string
    The create time of the instance.
    Description string
    The description of the instance.
    EntityQuota int
    The instance quota which indicating the maximum number of tables.
    Id string
    ID of the instance.
    Name string
    Instance name.
    Network string
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    ReadCapacity int
    The maximum adjustable read capacity unit of the instance.
    Status string
    Instance status. Possible values: Running, Disabled, Deleting.
    Tags Dictionary<string, object>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="userid_csharp">

    UserId string

    The user id of the instance.
    WriteCapacity int
    The maximum adjustable write capacity unit of the instance.

    ClusterType string
    The cluster type of the instance. Possible values: SSD, HYBRID.
    CreateTime string
    The create time of the instance.
    Description string
    The description of the instance.
    EntityQuota int
    The instance quota which indicating the maximum number of tables.
    Id string
    ID of the instance.
    Name string
    Instance name.
    Network string
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    ReadCapacity int
    The maximum adjustable read capacity unit of the instance.
    Status string
    Instance status. Possible values: Running, Disabled, Deleting.
    Tags map[string]interface{}
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="userid_go">

    UserId string

    The user id of the instance.
    WriteCapacity int
    The maximum adjustable write capacity unit of the instance.

    clusterType String
    The cluster type of the instance. Possible values: SSD, HYBRID.
    createTime String
    The create time of the instance.
    description String
    The description of the instance.
    entityQuota Integer
    The instance quota which indicating the maximum number of tables.
    id String
    ID of the instance.
    name String
    Instance name.
    network String
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    readCapacity Integer
    The maximum adjustable read capacity unit of the instance.
    status String
    Instance status. Possible values: Running, Disabled, Deleting.
    tags Map<String,Object>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="userid_java">

    userId String

    The user id of the instance.
    writeCapacity Integer
    The maximum adjustable write capacity unit of the instance.

    clusterType string
    The cluster type of the instance. Possible values: SSD, HYBRID.
    createTime string
    The create time of the instance.
    description string
    The description of the instance.
    entityQuota number
    The instance quota which indicating the maximum number of tables.
    id string
    ID of the instance.
    name string
    Instance name.
    network string
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    readCapacity number
    The maximum adjustable read capacity unit of the instance.
    status string
    Instance status. Possible values: Running, Disabled, Deleting.
    tags {[key: string]: any}
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="userid_nodejs">

    userId string

    The user id of the instance.
    writeCapacity number
    The maximum adjustable write capacity unit of the instance.

    cluster_type str
    The cluster type of the instance. Possible values: SSD, HYBRID.
    create_time str
    The create time of the instance.
    description str
    The description of the instance.
    entity_quota int
    The instance quota which indicating the maximum number of tables.
    id str
    ID of the instance.
    name str
    Instance name.
    network str
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    read_capacity int
    The maximum adjustable read capacity unit of the instance.
    status str
    Instance status. Possible values: Running, Disabled, Deleting.
    tags Mapping[str, Any]
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="user_id_python">

    user_id str

    The user id of the instance.
    write_capacity int
    The maximum adjustable write capacity unit of the instance.

    clusterType String
    The cluster type of the instance. Possible values: SSD, HYBRID.
    createTime String
    The create time of the instance.
    description String
    The description of the instance.
    entityQuota Number
    The instance quota which indicating the maximum number of tables.
    id String
    ID of the instance.
    name String
    Instance name.
    network String
    The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
    readCapacity Number
    The maximum adjustable read capacity unit of the instance.
    status String
    Instance status. Possible values: Running, Disabled, Deleting.
    tags Map<Any>
    A map of tags assigned to the instance. It must be in the format:

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    

    const instancesDs = alicloud.ots.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, });

    import pulumi
    import pulumi_alicloud as alicloud
    
    instances_ds = alicloud.ots.get_instances(tags={
        "tagKey1": "tagValue1",
        "tagKey2": "tagValue2",
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ots.GetInstances(ctx, &ots.GetInstancesArgs{
    			Tags: map[string]interface{}{
    				"tagKey1": "tagValue1",
    				"tagKey2": "tagValue2",
    			},
    		}, nil)
    		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.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetInstancesArgs;
    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 instancesDs = OtsFunctions.getInstances(GetInstancesArgs.builder()
                .tags(Map.ofEntries(
                    Map.entry("tagKey1", "tagValue1"),
                    Map.entry("tagKey2", "tagValue2")
                ))
                .build());
    
        }
    }
    
    variables:
      instancesDs:
        fn::invoke:
          Function: alicloud:ots:getInstances
          Arguments:
            tags:
              tagKey1: tagValue1
              tagKey2: tagValue2
    
    title="Required"> <span id="userid_yaml">

    userId String

    The user id of the instance.
    writeCapacity Number
    The maximum adjustable write capacity unit of the instance.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi