1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getRedisInstances
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getRedisInstances

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query the detail information of redis instance.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const redislab = tencentcloud.getRedisInstances({
        limit: 20,
        projectId: 0,
        resultOutputFile: "/tmp/redis_instances",
        searchKey: "myredis",
        zone: "ap-hongkong-1",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    redislab = tencentcloud.get_redis_instances(limit=20,
        project_id=0,
        result_output_file="/tmp/redis_instances",
        search_key="myredis",
        zone="ap-hongkong-1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.GetRedisInstances(ctx, &tencentcloud.GetRedisInstancesArgs{
    			Limit:            pulumi.Float64Ref(20),
    			ProjectId:        pulumi.Float64Ref(0),
    			ResultOutputFile: pulumi.StringRef("/tmp/redis_instances"),
    			SearchKey:        pulumi.StringRef("myredis"),
    			Zone:             pulumi.StringRef("ap-hongkong-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var redislab = Tencentcloud.GetRedisInstances.Invoke(new()
        {
            Limit = 20,
            ProjectId = 0,
            ResultOutputFile = "/tmp/redis_instances",
            SearchKey = "myredis",
            Zone = "ap-hongkong-1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetRedisInstancesArgs;
    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 redislab = TencentcloudFunctions.getRedisInstances(GetRedisInstancesArgs.builder()
                .limit(20)
                .projectId(0)
                .resultOutputFile("/tmp/redis_instances")
                .searchKey("myredis")
                .zone("ap-hongkong-1")
                .build());
    
        }
    }
    
    variables:
      redislab:
        fn::invoke:
          function: tencentcloud:getRedisInstances
          arguments:
            limit: 20
            projectId: 0
            resultOutputFile: /tmp/redis_instances
            searchKey: myredis
            zone: ap-hongkong-1
    

    Using getRedisInstances

    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 getRedisInstances(args: GetRedisInstancesArgs, opts?: InvokeOptions): Promise<GetRedisInstancesResult>
    function getRedisInstancesOutput(args: GetRedisInstancesOutputArgs, opts?: InvokeOptions): Output<GetRedisInstancesResult>
    def get_redis_instances(id: Optional[str] = None,
                            limit: Optional[float] = None,
                            project_id: Optional[float] = None,
                            result_output_file: Optional[str] = None,
                            search_key: Optional[str] = None,
                            tags: Optional[Mapping[str, str]] = None,
                            zone: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetRedisInstancesResult
    def get_redis_instances_output(id: Optional[pulumi.Input[str]] = None,
                            limit: Optional[pulumi.Input[float]] = None,
                            project_id: Optional[pulumi.Input[float]] = None,
                            result_output_file: Optional[pulumi.Input[str]] = None,
                            search_key: Optional[pulumi.Input[str]] = None,
                            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                            zone: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetRedisInstancesResult]
    func GetRedisInstances(ctx *Context, args *GetRedisInstancesArgs, opts ...InvokeOption) (*GetRedisInstancesResult, error)
    func GetRedisInstancesOutput(ctx *Context, args *GetRedisInstancesOutputArgs, opts ...InvokeOption) GetRedisInstancesResultOutput

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

    public static class GetRedisInstances 
    {
        public static Task<GetRedisInstancesResult> InvokeAsync(GetRedisInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetRedisInstancesResult> Invoke(GetRedisInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRedisInstancesResult> getRedisInstances(GetRedisInstancesArgs args, InvokeOptions options)
    public static Output<GetRedisInstancesResult> getRedisInstances(GetRedisInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getRedisInstances:getRedisInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    ID of the master or replica node.
    Limit double
    The number limitation of results for a query.
    ProjectId double
    ID of the project to which redis instance belongs.
    ResultOutputFile string
    Used to save results.
    SearchKey string
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    Tags Dictionary<string, string>
    Tags of redis instance.
    Zone string
    ID of an available zone.
    Id string
    ID of the master or replica node.
    Limit float64
    The number limitation of results for a query.
    ProjectId float64
    ID of the project to which redis instance belongs.
    ResultOutputFile string
    Used to save results.
    SearchKey string
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    Tags map[string]string
    Tags of redis instance.
    Zone string
    ID of an available zone.
    id String
    ID of the master or replica node.
    limit Double
    The number limitation of results for a query.
    projectId Double
    ID of the project to which redis instance belongs.
    resultOutputFile String
    Used to save results.
    searchKey String
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    tags Map<String,String>
    Tags of redis instance.
    zone String
    ID of an available zone.
    id string
    ID of the master or replica node.
    limit number
    The number limitation of results for a query.
    projectId number
    ID of the project to which redis instance belongs.
    resultOutputFile string
    Used to save results.
    searchKey string
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    tags {[key: string]: string}
    Tags of redis instance.
    zone string
    ID of an available zone.
    id str
    ID of the master or replica node.
    limit float
    The number limitation of results for a query.
    project_id float
    ID of the project to which redis instance belongs.
    result_output_file str
    Used to save results.
    search_key str
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    tags Mapping[str, str]
    Tags of redis instance.
    zone str
    ID of an available zone.
    id String
    ID of the master or replica node.
    limit Number
    The number limitation of results for a query.
    projectId Number
    ID of the project to which redis instance belongs.
    resultOutputFile String
    Used to save results.
    searchKey String
    Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
    tags Map<String>
    Tags of redis instance.
    zone String
    ID of an available zone.

    getRedisInstances Result

    The following output properties are available:

    Id string
    ID of the master or replica node.
    InstanceLists List<GetRedisInstancesInstanceList>
    A list of redis instance. Each element contains the following attributes:
    Limit double
    ProjectId double
    ID of the project to which a redis instance belongs.
    ResultOutputFile string
    SearchKey string
    Tags Dictionary<string, string>
    Tags of an instance.
    Zone string
    Available zone to which a redis instance belongs.
    Id string
    ID of the master or replica node.
    InstanceLists []GetRedisInstancesInstanceList
    A list of redis instance. Each element contains the following attributes:
    Limit float64
    ProjectId float64
    ID of the project to which a redis instance belongs.
    ResultOutputFile string
    SearchKey string
    Tags map[string]string
    Tags of an instance.
    Zone string
    Available zone to which a redis instance belongs.
    id String
    ID of the master or replica node.
    instanceLists List<GetRedisInstancesInstanceList>
    A list of redis instance. Each element contains the following attributes:
    limit Double
    projectId Double
    ID of the project to which a redis instance belongs.
    resultOutputFile String
    searchKey String
    tags Map<String,String>
    Tags of an instance.
    zone String
    Available zone to which a redis instance belongs.
    id string
    ID of the master or replica node.
    instanceLists GetRedisInstancesInstanceList[]
    A list of redis instance. Each element contains the following attributes:
    limit number
    projectId number
    ID of the project to which a redis instance belongs.
    resultOutputFile string
    searchKey string
    tags {[key: string]: string}
    Tags of an instance.
    zone string
    Available zone to which a redis instance belongs.
    id str
    ID of the master or replica node.
    instance_lists Sequence[GetRedisInstancesInstanceList]
    A list of redis instance. Each element contains the following attributes:
    limit float
    project_id float
    ID of the project to which a redis instance belongs.
    result_output_file str
    search_key str
    tags Mapping[str, str]
    Tags of an instance.
    zone str
    Available zone to which a redis instance belongs.
    id String
    ID of the master or replica node.
    instanceLists List<Property Map>
    A list of redis instance. Each element contains the following attributes:
    limit Number
    projectId Number
    ID of the project to which a redis instance belongs.
    resultOutputFile String
    searchKey String
    tags Map<String>
    Tags of an instance.
    zone String
    Available zone to which a redis instance belongs.

    Supporting Types

    GetRedisInstancesInstanceList

    ChargeType string
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    CreateTime string
    The time when the instance is created.
    Ip string
    IP address of an instance.
    MemSize double
    Memory size in MB.
    Name string
    Name of a redis instance.
    NodeInfos List<GetRedisInstancesInstanceListNodeInfo>
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    Port double
    The port used to access a redis instance.
    ProjectId double
    ID of the project to which redis instance belongs.
    RedisId string
    ID of a redis instance.
    RedisReplicasNum double
    The number of instance copies.
    RedisShardNum double
    The number of instance shard.
    Status string
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    SubnetId string
    ID of the vpc subnet.
    Tags Dictionary<string, string>
    Tags of redis instance.
    Type string
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    TypeId double
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    VpcId string
    ID of the vpc with which the instance is associated.
    Zone string
    ID of an available zone.
    ChargeType string
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    CreateTime string
    The time when the instance is created.
    Ip string
    IP address of an instance.
    MemSize float64
    Memory size in MB.
    Name string
    Name of a redis instance.
    NodeInfos []GetRedisInstancesInstanceListNodeInfo
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    Port float64
    The port used to access a redis instance.
    ProjectId float64
    ID of the project to which redis instance belongs.
    RedisId string
    ID of a redis instance.
    RedisReplicasNum float64
    The number of instance copies.
    RedisShardNum float64
    The number of instance shard.
    Status string
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    SubnetId string
    ID of the vpc subnet.
    Tags map[string]string
    Tags of redis instance.
    Type string
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    TypeId float64
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    VpcId string
    ID of the vpc with which the instance is associated.
    Zone string
    ID of an available zone.
    chargeType String
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    createTime String
    The time when the instance is created.
    ip String
    IP address of an instance.
    memSize Double
    Memory size in MB.
    name String
    Name of a redis instance.
    nodeInfos List<GetRedisInstancesInstanceListNodeInfo>
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    port Double
    The port used to access a redis instance.
    projectId Double
    ID of the project to which redis instance belongs.
    redisId String
    ID of a redis instance.
    redisReplicasNum Double
    The number of instance copies.
    redisShardNum Double
    The number of instance shard.
    status String
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    subnetId String
    ID of the vpc subnet.
    tags Map<String,String>
    Tags of redis instance.
    type String
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    typeId Double
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    vpcId String
    ID of the vpc with which the instance is associated.
    zone String
    ID of an available zone.
    chargeType string
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    createTime string
    The time when the instance is created.
    ip string
    IP address of an instance.
    memSize number
    Memory size in MB.
    name string
    Name of a redis instance.
    nodeInfos GetRedisInstancesInstanceListNodeInfo[]
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    port number
    The port used to access a redis instance.
    projectId number
    ID of the project to which redis instance belongs.
    redisId string
    ID of a redis instance.
    redisReplicasNum number
    The number of instance copies.
    redisShardNum number
    The number of instance shard.
    status string
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    subnetId string
    ID of the vpc subnet.
    tags {[key: string]: string}
    Tags of redis instance.
    type string
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    typeId number
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    vpcId string
    ID of the vpc with which the instance is associated.
    zone string
    ID of an available zone.
    charge_type str
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    create_time str
    The time when the instance is created.
    ip str
    IP address of an instance.
    mem_size float
    Memory size in MB.
    name str
    Name of a redis instance.
    node_infos Sequence[GetRedisInstancesInstanceListNodeInfo]
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    port float
    The port used to access a redis instance.
    project_id float
    ID of the project to which redis instance belongs.
    redis_id str
    ID of a redis instance.
    redis_replicas_num float
    The number of instance copies.
    redis_shard_num float
    The number of instance shard.
    status str
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    subnet_id str
    ID of the vpc subnet.
    tags Mapping[str, str]
    Tags of redis instance.
    type str
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    type_id float
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    vpc_id str
    ID of the vpc with which the instance is associated.
    zone str
    ID of an available zone.
    chargeType String
    The charge type of instance. Valid values are POSTPAID and PREPAID.
    createTime String
    The time when the instance is created.
    ip String
    IP address of an instance.
    memSize Number
    Memory size in MB.
    name String
    Name of a redis instance.
    nodeInfos List<Property Map>
    List of instance node information. Currently, information about the node type (master or replica) and node availability zone can be passed in.
    port Number
    The port used to access a redis instance.
    projectId Number
    ID of the project to which redis instance belongs.
    redisId String
    ID of a redis instance.
    redisReplicasNum Number
    The number of instance copies.
    redisShardNum Number
    The number of instance shard.
    status String
    Current status of an instance, maybe: init, processing, online, isolate and todelete.
    subnetId String
    ID of the vpc subnet.
    tags Map<String>
    Tags of redis instance.
    type String
    (Deprecated) It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values: master_slave_redis, master_slave_ckv, cluster_ckv, cluster_redis and standalone_redis.
    typeId Number
    Instance type. Refer to data.tencentcloud_redis_zone_config.list.type_id get available values.
    vpcId String
    ID of the vpc with which the instance is associated.
    zone String
    ID of an available zone.

    GetRedisInstancesInstanceListNodeInfo

    Id double
    ID of the master or replica node.
    Master bool
    Indicates whether the node is master.
    ZoneId double
    ID of the availability zone of the master or replica node.
    Id float64
    ID of the master or replica node.
    Master bool
    Indicates whether the node is master.
    ZoneId float64
    ID of the availability zone of the master or replica node.
    id Double
    ID of the master or replica node.
    master Boolean
    Indicates whether the node is master.
    zoneId Double
    ID of the availability zone of the master or replica node.
    id number
    ID of the master or replica node.
    master boolean
    Indicates whether the node is master.
    zoneId number
    ID of the availability zone of the master or replica node.
    id float
    ID of the master or replica node.
    master bool
    Indicates whether the node is master.
    zone_id float
    ID of the availability zone of the master or replica node.
    id Number
    ID of the master or replica node.
    master Boolean
    Indicates whether the node is master.
    zoneId Number
    ID of the availability zone of the master or replica node.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack