1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ots
  5. getInstances
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ots.getInstances

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

NOTE: Available since v1.40.0.

Example Usage

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

const instancesDs = alicloud.ots.getInstances({
    outputFile: "instances.txt",
});
export const firstInstanceId = instancesDs.then(instancesDs => instancesDs.instances?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

instances_ds = alicloud.ots.get_instances(output_file="instances.txt")
pulumi.export("firstInstanceId", instances_ds.instances[0].id)
Copy
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{
			OutputFile: pulumi.StringRef("instances.txt"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstInstanceId", instancesDs.Instances[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var instancesDs = AliCloud.Ots.GetInstances.Invoke(new()
    {
        OutputFile = "instances.txt",
    });

    return new Dictionary<string, object?>
    {
        ["firstInstanceId"] = instancesDs.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
    };
});
Copy
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()
            .outputFile("instances.txt")
            .build());

        ctx.export("firstInstanceId", instancesDs.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
    }
}
Copy
variables:
  instancesDs:
    fn::invoke:
      function: alicloud:ots:getInstances
      arguments:
        outputFile: instances.txt
outputs:
  firstInstanceId: ${instancesDs.instances[0].id}
Copy

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

> 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)
}
Copy
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ots/getInstances:getInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of instance IDs.
NameRegex Changes to this property will trigger replacement. 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, string>
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 Changes to this property will trigger replacement. []string
A list of instance IDs.
NameRegex Changes to this property will trigger replacement. 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]string
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 Changes to this property will trigger replacement. List<String>
A list of instance IDs.
nameRegex Changes to this property will trigger replacement. 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,String>
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 Changes to this property will trigger replacement. string[]
A list of instance IDs.
nameRegex Changes to this property will trigger replacement. 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]: string}
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 Changes to this property will trigger replacement. Sequence[str]
A list of instance IDs.
name_regex Changes to this property will trigger replacement. 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, str]
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 Changes to this property will trigger replacement. List<String>
A list of instance IDs.
nameRegex Changes to this property will trigger replacement. 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>
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, string>
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]string
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,String>
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]: string}
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, str]
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<String>
The tags of the instance.

Supporting Types

GetInstancesInstance

ClusterType This property is required. string
The cluster type of the instance. Possible values: SSD, HYBRID.
CreateTime This property is required. string
The create time of the instance.
Description This property is required. string
The description of the instance.
EntityQuota This property is required. int
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
Id This property is required. string
ID of the instance.
Name This property is required. string
Instance name.
Network This property is required. string
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
NetworkSourceAcls This property is required. List<string>
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
NetworkTypeAcls This property is required. List<string>
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
Policy This property is required. string
(Available since v1.221.0) instance policy, json string.
PolicyVersion This property is required. int
(Available since v1.221.0) instance policy version.
ResourceGroupId This property is required. string
(Available since v1.221.0) The resource group the instance belongs to.
Status This property is required. string
Instance status. Possible values: Running, Disabled, Deleting.
TableQuota This property is required. int
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
Tags This property is required. Dictionary<string, string>
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 This property is required. string

The user id of the instance.

ClusterType This property is required. string
The cluster type of the instance. Possible values: SSD, HYBRID.
CreateTime This property is required. string
The create time of the instance.
Description This property is required. string
The description of the instance.
EntityQuota This property is required. int
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
Id This property is required. string
ID of the instance.
Name This property is required. string
Instance name.
Network This property is required. string
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
NetworkSourceAcls This property is required. []string
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
NetworkTypeAcls This property is required. []string
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
Policy This property is required. string
(Available since v1.221.0) instance policy, json string.
PolicyVersion This property is required. int
(Available since v1.221.0) instance policy version.
ResourceGroupId This property is required. string
(Available since v1.221.0) The resource group the instance belongs to.
Status This property is required. string
Instance status. Possible values: Running, Disabled, Deleting.
TableQuota This property is required. int
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
Tags This property is required. map[string]string
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 This property is required. string

The user id of the instance.

clusterType This property is required. String
The cluster type of the instance. Possible values: SSD, HYBRID.
createTime This property is required. String
The create time of the instance.
description This property is required. String
The description of the instance.
entityQuota This property is required. Integer
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
id This property is required. String
ID of the instance.
name This property is required. String
Instance name.
network This property is required. String
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
networkSourceAcls This property is required. List<String>
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
networkTypeAcls This property is required. List<String>
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
policy This property is required. String
(Available since v1.221.0) instance policy, json string.
policyVersion This property is required. Integer
(Available since v1.221.0) instance policy version.
resourceGroupId This property is required. String
(Available since v1.221.0) The resource group the instance belongs to.
status This property is required. String
Instance status. Possible values: Running, Disabled, Deleting.
tableQuota This property is required. Integer
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
tags This property is required. Map<String,String>
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 This property is required. String

The user id of the instance.

clusterType This property is required. string
The cluster type of the instance. Possible values: SSD, HYBRID.
createTime This property is required. string
The create time of the instance.
description This property is required. string
The description of the instance.
entityQuota This property is required. number
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
id This property is required. string
ID of the instance.
name This property is required. string
Instance name.
network This property is required. string
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
networkSourceAcls This property is required. string[]
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
networkTypeAcls This property is required. string[]
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
policy This property is required. string
(Available since v1.221.0) instance policy, json string.
policyVersion This property is required. number
(Available since v1.221.0) instance policy version.
resourceGroupId This property is required. string
(Available since v1.221.0) The resource group the instance belongs to.
status This property is required. string
Instance status. Possible values: Running, Disabled, Deleting.
tableQuota This property is required. number
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
tags This property is required. {[key: string]: string}
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 This property is required. string

The user id of the instance.

cluster_type This property is required. str
The cluster type of the instance. Possible values: SSD, HYBRID.
create_time This property is required. str
The create time of the instance.
description This property is required. str
The description of the instance.
entity_quota This property is required. int
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
id This property is required. str
ID of the instance.
name This property is required. str
Instance name.
network This property is required. str
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
network_source_acls This property is required. Sequence[str]
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
network_type_acls This property is required. Sequence[str]
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
policy This property is required. str
(Available since v1.221.0) instance policy, json string.
policy_version This property is required. int
(Available since v1.221.0) instance policy version.
resource_group_id This property is required. str
(Available since v1.221.0) The resource group the instance belongs to.
status This property is required. str
Instance status. Possible values: Running, Disabled, Deleting.
table_quota This property is required. int
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
tags This property is required. Mapping[str, str]
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 This property is required. str

The user id of the instance.

clusterType This property is required. String
The cluster type of the instance. Possible values: SSD, HYBRID.
createTime This property is required. String
The create time of the instance.
description This property is required. String
The description of the instance.
entityQuota This property is required. Number
(Removed since v1.221.0) The instance quota which indicating the maximum number of tables.
id This property is required. String
ID of the instance.
name This property is required. String
Instance name.
network This property is required. String
(Removed since v1.221.0) The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.
networkSourceAcls This property is required. List<String>
(Available since v1.221.0) The set of request sources that are allowed access. Possible values: TRUST_PROXY.
networkTypeAcls This property is required. List<String>
(Available since v1.221.0) The set of network types that are allowed access. Possible values: CLASSIC, VPC, INTERNET.
policy This property is required. String
(Available since v1.221.0) instance policy, json string.
policyVersion This property is required. Number
(Available since v1.221.0) instance policy version.
resourceGroupId This property is required. String
(Available since v1.221.0) The resource group the instance belongs to.
status This property is required. String
Instance status. Possible values: Running, Disabled, Deleting.
tableQuota This property is required. Number
(Available since v1.221.0) The instance quota which indicating the maximum number of tables.
tags This property is required. Map<String>
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 This property is required. String

The user id 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi