get Instances
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.Apply(@default => @default.Apply(getInstancesResult => getInstancesResult.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
A collection of arguments for invoking getInstances.
Return
A collection of values returned by getInstances.
Parameters
The type of the architecture. Valid values: cluster
, standard
and SplitRW
.
Used to retrieve instances belong to specified vswitch
resources. Valid values: Enterprise
, Community
.
Default to false
. Set it to true can output more details.
The engine version. Valid values: 2.8
, 4.0
, 5.0
, 6.0
, 7.0
.
The expiration status of the instance.
Whether to create a distributed cache.
A list of KVStore DBInstance IDs.
Type of the applied Tair (Redis OSS-Compatible) And Memcache (KVStore) Classic Instance. For more information, see Instance type table.
The engine type of the KVStore DBInstance. Options are Memcache
, and Redis
. If no value is specified, all types are returned.
A regex string to apply to the instance name.
The type of the network. Valid values: CLASSIC
, VPC
.
The name of file that can save the collection of instances after running pulumi preview
.
The payment type. Valid values: PostPaid
, PrePaid
.
The ID of the resource group.
The name of the instance.
The status of the KVStore DBInstance. Valid values: Changing
, CleaningUpExpiredData
, Creating
, Flushing
, HASwitching
, Inactive
, MajorVersionUpgrading
, Migrating
, NetworkModifying
, Normal
, Rebooting
, SSLModifying
, Transforming
, ZoneMigrating
.
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"}
.
Used to retrieve instances belong to specified VPC.
Used to retrieve instances belong to specified vswitch
resources.
The ID of the zone.
See also
Return
A collection of values returned by getInstances.
Parameters
Builder for com.pulumi.alicloud.kvstore.kotlin.inputs.GetInstancesPlainArgs.