getInstances

This data source provides the Tair (Redis OSS-Compatible) And Memcache (KVStore) Instances of the current Alibaba Cloud user.

NOTE: Available since v1.15.0.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.kvstore.getInstances({
nameRegex: "testname",
});
export const firstInstanceName = _default.then(_default => _default.instances?.[0]?.name);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.kvstore.get_instances(name_regex="testname")
pulumi.export("firstInstanceName", default.instances[0].name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.KVStore.GetInstances.Invoke(new()
{
NameRegex = "testname",
});
return new Dictionary<string, object?>
{
["firstInstanceName"] = @default&#46;Apply(@default => @default&#46;Apply(getInstancesResult => getInstancesResult&#46;Instances[0]?.Name)),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kvstore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := kvstore.GetInstances(ctx, &kvstore.GetInstancesArgs{
NameRegex: pulumi.StringRef("testname"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstInstanceName", _default.Instances[0].Name)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kvstore.KvstoreFunctions;
import com.pulumi.alicloud.kvstore.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 default = KvstoreFunctions.getInstances(GetInstancesArgs.builder()
.nameRegex("testname")
.build());
ctx.export("firstInstanceName", default_.instances()[0].name());
}
}
variables:
default:
fn::invoke:
function: alicloud:kvstore:getInstances
arguments:
nameRegex: testname
outputs:
firstInstanceName: ${default.instances[0].name}

Return

A collection of values returned by getInstances.

Parameters

argument

A collection of arguments for invoking getInstances.


suspend fun getInstances(architectureType: String? = null, editionType: String? = null, enableDetails: Boolean? = null, engineVersion: String? = null, expired: String? = null, globalInstance: Boolean? = null, ids: List<String>? = null, instanceClass: String? = null, instanceType: String? = null, nameRegex: String? = null, networkType: String? = null, outputFile: String? = null, paymentType: String? = null, resourceGroupId: String? = null, searchKey: String? = null, status: String? = null, tags: Map<String, String>? = null, vpcId: String? = null, vswitchId: String? = null, zoneId: String? = null): GetInstancesResult

Return

A collection of values returned by getInstances.

Parameters

architectureType

The type of the architecture. Valid values: cluster, standard and SplitRW.

editionType

Used to retrieve instances belong to specified vswitch resources. Valid values: Enterprise, Community.

enableDetails

Default to false. Set it to true can output more details.

engineVersion

The engine version. Valid values: 2.8, 4.0, 5.0, 6.0, 7.0.

expired

The expiration status of the instance.

globalInstance

Whether to create a distributed cache.

ids

A list of KVStore DBInstance IDs.

instanceClass

Type of the applied Tair (Redis OSS-Compatible) And Memcache (KVStore) Classic Instance. For more information, see Instance type table.

instanceType

The engine type of the KVStore DBInstance. Options are Memcache, and Redis. If no value is specified, all types are returned.

nameRegex

A regex string to apply to the instance name.

networkType

The type of the network. Valid values: CLASSIC, VPC.

outputFile

The name of file that can save the collection of instances after running pulumi preview.

paymentType

The payment type. Valid values: PostPaid, PrePaid.

resourceGroupId

The ID of the resource group.

searchKey

The name of the instance.

status

The status of the KVStore DBInstance. Valid values: Changing, CleaningUpExpiredData, Creating, Flushing, HASwitching, Inactive, MajorVersionUpgrading, Migrating, NetworkModifying, Normal, Rebooting, SSLModifying, Transforming, ZoneMigrating.

tags

Query the instance bound to the tag. The format of the incoming value is json string, including TagKey and TagValue. TagKey cannot be null, and TagValue can be empty. Format example {"key1":"value1"}.

vpcId

Used to retrieve instances belong to specified VPC.

vswitchId

Used to retrieve instances belong to specified vswitch resources.

zoneId

The ID of the zone.

See also


Return

A collection of values returned by getInstances.

Parameters

argument

Builder for com.pulumi.alicloud.kvstore.kotlin.inputs.GetInstancesPlainArgs.

See also