tencentcloud.RedisInstance
Provides a resource to create a Redis instance and set its attributes.
NOTE: The argument vpc_id and subnet_id is now required because Basic Network Instance is no longer supported.
NOTE: Both adding and removing replications in one change is supported but not recommend.
Example Usage
Create a base version of redis
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zone = tencentcloud.getRedisZoneConfig({
typeId: 7,
});
const vpc = new tencentcloud.Vpc("vpc", {
cidrBlock: "10.0.0.0/16",
name: "tf_redis_vpc",
});
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: zone.then(zone => zone.lists?.[0]?.zone),
name: "tf_redis_subnet",
cidrBlock: "10.0.1.0/24",
});
const example = new tencentcloud.RedisInstance("example", {
availabilityZone: zone.then(zone => zone.lists?.[0]?.zone),
typeId: zone.then(zone => zone.lists?.[0]?.typeId),
password: "Password@123",
memSize: 8192,
redisShardNum: zone.then(zone => zone.lists?.[0]?.redisShardNums?.[0]),
redisReplicasNum: zone.then(zone => zone.lists?.[0]?.redisReplicasNums?.[0]),
name: "tf-example",
port: 6379,
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zone = tencentcloud.get_redis_zone_config(type_id=7)
vpc = tencentcloud.Vpc("vpc",
cidr_block="10.0.0.0/16",
name="tf_redis_vpc")
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=zone.lists[0].zone,
name="tf_redis_subnet",
cidr_block="10.0.1.0/24")
example = tencentcloud.RedisInstance("example",
availability_zone=zone.lists[0].zone,
type_id=zone.lists[0].type_id,
password="Password@123",
mem_size=8192,
redis_shard_num=zone.lists[0].redis_shard_nums[0],
redis_replicas_num=zone.lists[0].redis_replicas_nums[0],
name="tf-example",
port=6379,
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id)
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 {
zone, err := tencentcloud.GetRedisZoneConfig(ctx, &tencentcloud.GetRedisZoneConfigArgs{
TypeId: pulumi.Float64Ref(7),
}, nil)
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
Name: pulumi.String("tf_redis_vpc"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(zone.Lists[0].Zone),
Name: pulumi.String("tf_redis_subnet"),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewRedisInstance(ctx, "example", &tencentcloud.RedisInstanceArgs{
AvailabilityZone: pulumi.String(zone.Lists[0].Zone),
TypeId: pulumi.Float64(zone.Lists[0].TypeId),
Password: pulumi.String("Password@123"),
MemSize: pulumi.Float64(8192),
RedisShardNum: pulumi.Float64(zone.Lists[0].RedisShardNums[0]),
RedisReplicasNum: pulumi.Float64(zone.Lists[0].RedisReplicasNums[0]),
Name: pulumi.String("tf-example"),
Port: pulumi.Float64(6379),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
})
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 zone = Tencentcloud.GetRedisZoneConfig.Invoke(new()
{
TypeId = 7,
});
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
Name = "tf_redis_vpc",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.Zone),
Name = "tf_redis_subnet",
CidrBlock = "10.0.1.0/24",
});
var example = new Tencentcloud.RedisInstance("example", new()
{
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.Zone),
TypeId = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.TypeId),
Password = "Password@123",
MemSize = 8192,
RedisShardNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisShardNums[0]),
RedisReplicasNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisReplicasNums[0]),
Name = "tf-example",
Port = 6379,
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
});
});
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.GetRedisZoneConfigArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.RedisInstance;
import com.pulumi.tencentcloud.RedisInstanceArgs;
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 zone = TencentcloudFunctions.getRedisZoneConfig(GetRedisZoneConfigArgs.builder()
.typeId(7)
.build());
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.name("tf_redis_vpc")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(zone.lists()[0].zone())
.name("tf_redis_subnet")
.cidrBlock("10.0.1.0/24")
.build());
var example = new RedisInstance("example", RedisInstanceArgs.builder()
.availabilityZone(zone.lists()[0].zone())
.typeId(zone.lists()[0].typeId())
.password("Password@123")
.memSize(8192.0)
.redisShardNum(zone.lists()[0].redisShardNums()[0])
.redisReplicasNum(zone.lists()[0].redisReplicasNums()[0])
.name("tf-example")
.port(6379.0)
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
name: tf_redis_vpc
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${zone.lists[0].zone}
name: tf_redis_subnet
cidrBlock: 10.0.1.0/24
example:
type: tencentcloud:RedisInstance
properties:
availabilityZone: ${zone.lists[0].zone}
typeId: ${zone.lists[0].typeId}
password: Password@123
memSize: 8192
redisShardNum: ${zone.lists[0].redisShardNums[0]}
redisReplicasNum: ${zone.lists[0].redisReplicasNums[0]}
name: tf-example
port: 6379
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
variables:
zone:
fn::invoke:
function: tencentcloud:getRedisZoneConfig
arguments:
typeId: 7
Buy a month of prepaid instances
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zone = tencentcloud.getRedisZoneConfig({
typeId: 7,
});
const vpc = new tencentcloud.Vpc("vpc", {
cidrBlock: "10.0.0.0/16",
name: "tf_redis_vpc",
});
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: zone.then(zone => zone.lists?.[1]?.zone),
name: "tf_redis_subnet",
cidrBlock: "10.0.1.0/24",
});
const securityGroup = new tencentcloud.SecurityGroup("security_group", {name: "tf-redis-sg"});
const sgRule = new tencentcloud.SecurityGroupLiteRule("sg_rule", {
securityGroupId: securityGroup.securityGroupId,
ingresses: [
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
],
egresses: [
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
],
});
const example = new tencentcloud.RedisInstance("example", {
availabilityZone: zone.then(zone => zone.lists?.[0]?.zone),
typeId: zone.then(zone => zone.lists?.[0]?.typeId),
password: "Password@123",
memSize: 8192,
redisShardNum: zone.then(zone => zone.lists?.[0]?.redisShardNums?.[0]),
redisReplicasNum: zone.then(zone => zone.lists?.[0]?.redisReplicasNums?.[0]),
name: "tf-example",
port: 6379,
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
securityGroups: [securityGroup.securityGroupId],
chargeType: "PREPAID",
prepaidPeriod: 1,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zone = tencentcloud.get_redis_zone_config(type_id=7)
vpc = tencentcloud.Vpc("vpc",
cidr_block="10.0.0.0/16",
name="tf_redis_vpc")
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=zone.lists[1].zone,
name="tf_redis_subnet",
cidr_block="10.0.1.0/24")
security_group = tencentcloud.SecurityGroup("security_group", name="tf-redis-sg")
sg_rule = tencentcloud.SecurityGroupLiteRule("sg_rule",
security_group_id=security_group.security_group_id,
ingresses=[
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
],
egresses=[
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
])
example = tencentcloud.RedisInstance("example",
availability_zone=zone.lists[0].zone,
type_id=zone.lists[0].type_id,
password="Password@123",
mem_size=8192,
redis_shard_num=zone.lists[0].redis_shard_nums[0],
redis_replicas_num=zone.lists[0].redis_replicas_nums[0],
name="tf-example",
port=6379,
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
security_groups=[security_group.security_group_id],
charge_type="PREPAID",
prepaid_period=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 {
zone, err := tencentcloud.GetRedisZoneConfig(ctx, &tencentcloud.GetRedisZoneConfigArgs{
TypeId: pulumi.Float64Ref(7),
}, nil)
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
Name: pulumi.String("tf_redis_vpc"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(zone.Lists[1].Zone),
Name: pulumi.String("tf_redis_subnet"),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
securityGroup, err := tencentcloud.NewSecurityGroup(ctx, "security_group", &tencentcloud.SecurityGroupArgs{
Name: pulumi.String("tf-redis-sg"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewSecurityGroupLiteRule(ctx, "sg_rule", &tencentcloud.SecurityGroupLiteRuleArgs{
SecurityGroupId: securityGroup.SecurityGroupId,
Ingresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.1.0/24#80#TCP"),
pulumi.String("DROP#8.8.8.8#80,90#UDP"),
pulumi.String("DROP#0.0.0.0/0#80-90#TCP"),
},
Egresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.0.0/16#ALL#TCP"),
pulumi.String("ACCEPT#10.0.0.0/8#ALL#ICMP"),
pulumi.String("DROP#0.0.0.0/0#ALL#ALL"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewRedisInstance(ctx, "example", &tencentcloud.RedisInstanceArgs{
AvailabilityZone: pulumi.String(zone.Lists[0].Zone),
TypeId: pulumi.Float64(zone.Lists[0].TypeId),
Password: pulumi.String("Password@123"),
MemSize: pulumi.Float64(8192),
RedisShardNum: pulumi.Float64(zone.Lists[0].RedisShardNums[0]),
RedisReplicasNum: pulumi.Float64(zone.Lists[0].RedisReplicasNums[0]),
Name: pulumi.String("tf-example"),
Port: pulumi.Float64(6379),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
SecurityGroups: pulumi.StringArray{
securityGroup.SecurityGroupId,
},
ChargeType: pulumi.String("PREPAID"),
PrepaidPeriod: pulumi.Float64(1),
})
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 zone = Tencentcloud.GetRedisZoneConfig.Invoke(new()
{
TypeId = 7,
});
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
Name = "tf_redis_vpc",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[1]?.Zone),
Name = "tf_redis_subnet",
CidrBlock = "10.0.1.0/24",
});
var securityGroup = new Tencentcloud.SecurityGroup("security_group", new()
{
Name = "tf-redis-sg",
});
var sgRule = new Tencentcloud.SecurityGroupLiteRule("sg_rule", new()
{
SecurityGroupId = securityGroup.SecurityGroupId,
Ingresses = new[]
{
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
},
Egresses = new[]
{
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
},
});
var example = new Tencentcloud.RedisInstance("example", new()
{
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.Zone),
TypeId = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.TypeId),
Password = "Password@123",
MemSize = 8192,
RedisShardNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisShardNums[0]),
RedisReplicasNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisReplicasNums[0]),
Name = "tf-example",
Port = 6379,
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
SecurityGroups = new[]
{
securityGroup.SecurityGroupId,
},
ChargeType = "PREPAID",
PrepaidPeriod = 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.GetRedisZoneConfigArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.SecurityGroup;
import com.pulumi.tencentcloud.SecurityGroupArgs;
import com.pulumi.tencentcloud.SecurityGroupLiteRule;
import com.pulumi.tencentcloud.SecurityGroupLiteRuleArgs;
import com.pulumi.tencentcloud.RedisInstance;
import com.pulumi.tencentcloud.RedisInstanceArgs;
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 zone = TencentcloudFunctions.getRedisZoneConfig(GetRedisZoneConfigArgs.builder()
.typeId(7)
.build());
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.name("tf_redis_vpc")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(zone.lists()[1].zone())
.name("tf_redis_subnet")
.cidrBlock("10.0.1.0/24")
.build());
var securityGroup = new SecurityGroup("securityGroup", SecurityGroupArgs.builder()
.name("tf-redis-sg")
.build());
var sgRule = new SecurityGroupLiteRule("sgRule", SecurityGroupLiteRuleArgs.builder()
.securityGroupId(securityGroup.securityGroupId())
.ingresses(
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP")
.egresses(
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL")
.build());
var example = new RedisInstance("example", RedisInstanceArgs.builder()
.availabilityZone(zone.lists()[0].zone())
.typeId(zone.lists()[0].typeId())
.password("Password@123")
.memSize(8192.0)
.redisShardNum(zone.lists()[0].redisShardNums()[0])
.redisReplicasNum(zone.lists()[0].redisReplicasNums()[0])
.name("tf-example")
.port(6379.0)
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.securityGroups(securityGroup.securityGroupId())
.chargeType("PREPAID")
.prepaidPeriod(1.0)
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
name: tf_redis_vpc
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${zone.lists[1].zone}
name: tf_redis_subnet
cidrBlock: 10.0.1.0/24
securityGroup:
type: tencentcloud:SecurityGroup
name: security_group
properties:
name: tf-redis-sg
sgRule:
type: tencentcloud:SecurityGroupLiteRule
name: sg_rule
properties:
securityGroupId: ${securityGroup.securityGroupId}
ingresses:
- ACCEPT#192.168.1.0/24#80#TCP
- DROP#8.8.8.8#80,90#UDP
- DROP#0.0.0.0/0#80-90#TCP
egresses:
- ACCEPT#192.168.0.0/16#ALL#TCP
- ACCEPT#10.0.0.0/8#ALL#ICMP
- DROP#0.0.0.0/0#ALL#ALL
example:
type: tencentcloud:RedisInstance
properties:
availabilityZone: ${zone.lists[0].zone}
typeId: ${zone.lists[0].typeId}
password: Password@123
memSize: 8192
redisShardNum: ${zone.lists[0].redisShardNums[0]}
redisReplicasNum: ${zone.lists[0].redisReplicasNums[0]}
name: tf-example
port: 6379
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
securityGroups:
- ${securityGroup.securityGroupId}
chargeType: PREPAID
prepaidPeriod: 1
variables:
zone:
fn::invoke:
function: tencentcloud:getRedisZoneConfig
arguments:
typeId: 7
Create a multi-AZ instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zone = tencentcloud.getRedisZoneConfig({
typeId: 7,
region: "ap-guangzhou",
});
const config = new pulumi.Config();
const replicaZoneIds = config.getObject<any>("replicaZoneIds") || [
100004,
100006,
];
const vpc = new tencentcloud.Vpc("vpc", {
cidrBlock: "10.0.0.0/16",
name: "tf_redis_vpc",
});
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: zone.then(zone => zone.lists?.[2]?.zone),
name: "tf_redis_subnet",
cidrBlock: "10.0.1.0/24",
});
const securityGroup = new tencentcloud.SecurityGroup("security_group", {name: "tf-redis-sg"});
const sgRule = new tencentcloud.SecurityGroupLiteRule("sg_rule", {
securityGroupId: securityGroup.securityGroupId,
ingresses: [
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
],
egresses: [
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
],
});
const example = new tencentcloud.RedisInstance("example", {
availabilityZone: zone.then(zone => zone.lists?.[2]?.zone),
typeId: zone.then(zone => zone.lists?.[2]?.typeId),
password: "Password@123",
memSize: 8192,
redisShardNum: zone.then(zone => zone.lists?.[2]?.redisShardNums?.[0]),
redisReplicasNum: 2,
replicaZoneIds: replicaZoneIds,
name: "tf-example",
port: 6379,
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
securityGroups: [securityGroup.securityGroupId],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zone = tencentcloud.get_redis_zone_config(type_id=7,
region="ap-guangzhou")
config = pulumi.Config()
replica_zone_ids = config.get_object("replicaZoneIds")
if replica_zone_ids is None:
replica_zone_ids = [
100004,
100006,
]
vpc = tencentcloud.Vpc("vpc",
cidr_block="10.0.0.0/16",
name="tf_redis_vpc")
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=zone.lists[2].zone,
name="tf_redis_subnet",
cidr_block="10.0.1.0/24")
security_group = tencentcloud.SecurityGroup("security_group", name="tf-redis-sg")
sg_rule = tencentcloud.SecurityGroupLiteRule("sg_rule",
security_group_id=security_group.security_group_id,
ingresses=[
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
],
egresses=[
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
])
example = tencentcloud.RedisInstance("example",
availability_zone=zone.lists[2].zone,
type_id=zone.lists[2].type_id,
password="Password@123",
mem_size=8192,
redis_shard_num=zone.lists[2].redis_shard_nums[0],
redis_replicas_num=2,
replica_zone_ids=replica_zone_ids,
name="tf-example",
port=6379,
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
security_groups=[security_group.security_group_id])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
zone, err := tencentcloud.GetRedisZoneConfig(ctx, &tencentcloud.GetRedisZoneConfigArgs{
TypeId: pulumi.Float64Ref(7),
Region: pulumi.StringRef("ap-guangzhou"),
}, nil)
if err != nil {
return err
}
cfg := config.New(ctx, "")
replicaZoneIds := []float64{
100004,
100006,
}
if param := cfg.GetObject("replicaZoneIds"); param != nil {
replicaZoneIds = param
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
Name: pulumi.String("tf_redis_vpc"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(zone.Lists[2].Zone),
Name: pulumi.String("tf_redis_subnet"),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
securityGroup, err := tencentcloud.NewSecurityGroup(ctx, "security_group", &tencentcloud.SecurityGroupArgs{
Name: pulumi.String("tf-redis-sg"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewSecurityGroupLiteRule(ctx, "sg_rule", &tencentcloud.SecurityGroupLiteRuleArgs{
SecurityGroupId: securityGroup.SecurityGroupId,
Ingresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.1.0/24#80#TCP"),
pulumi.String("DROP#8.8.8.8#80,90#UDP"),
pulumi.String("DROP#0.0.0.0/0#80-90#TCP"),
},
Egresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.0.0/16#ALL#TCP"),
pulumi.String("ACCEPT#10.0.0.0/8#ALL#ICMP"),
pulumi.String("DROP#0.0.0.0/0#ALL#ALL"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewRedisInstance(ctx, "example", &tencentcloud.RedisInstanceArgs{
AvailabilityZone: pulumi.String(zone.Lists[2].Zone),
TypeId: pulumi.Float64(zone.Lists[2].TypeId),
Password: pulumi.String("Password@123"),
MemSize: pulumi.Float64(8192),
RedisShardNum: pulumi.Float64(zone.Lists[2].RedisShardNums[0]),
RedisReplicasNum: pulumi.Float64(2),
ReplicaZoneIds: pulumi.Any(replicaZoneIds),
Name: pulumi.String("tf-example"),
Port: pulumi.Float64(6379),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
SecurityGroups: pulumi.StringArray{
securityGroup.SecurityGroupId,
},
})
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 zone = Tencentcloud.GetRedisZoneConfig.Invoke(new()
{
TypeId = 7,
Region = "ap-guangzhou",
});
var config = new Config();
var replicaZoneIds = config.GetObject<dynamic>("replicaZoneIds") ?? new[]
{
100004,
100006,
};
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
Name = "tf_redis_vpc",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.Zone),
Name = "tf_redis_subnet",
CidrBlock = "10.0.1.0/24",
});
var securityGroup = new Tencentcloud.SecurityGroup("security_group", new()
{
Name = "tf-redis-sg",
});
var sgRule = new Tencentcloud.SecurityGroupLiteRule("sg_rule", new()
{
SecurityGroupId = securityGroup.SecurityGroupId,
Ingresses = new[]
{
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP",
},
Egresses = new[]
{
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL",
},
});
var example = new Tencentcloud.RedisInstance("example", new()
{
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.Zone),
TypeId = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.TypeId),
Password = "Password@123",
MemSize = 8192,
RedisShardNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.RedisShardNums[0]),
RedisReplicasNum = 2,
ReplicaZoneIds = replicaZoneIds,
Name = "tf-example",
Port = 6379,
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
SecurityGroups = new[]
{
securityGroup.SecurityGroupId,
},
});
});
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.GetRedisZoneConfigArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.SecurityGroup;
import com.pulumi.tencentcloud.SecurityGroupArgs;
import com.pulumi.tencentcloud.SecurityGroupLiteRule;
import com.pulumi.tencentcloud.SecurityGroupLiteRuleArgs;
import com.pulumi.tencentcloud.RedisInstance;
import com.pulumi.tencentcloud.RedisInstanceArgs;
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 config = ctx.config();
final var zone = TencentcloudFunctions.getRedisZoneConfig(GetRedisZoneConfigArgs.builder()
.typeId(7)
.region("ap-guangzhou")
.build());
final var replicaZoneIds = config.get("replicaZoneIds").orElse(List.of(
100004,
100006));
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.name("tf_redis_vpc")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(zone.lists()[2].zone())
.name("tf_redis_subnet")
.cidrBlock("10.0.1.0/24")
.build());
var securityGroup = new SecurityGroup("securityGroup", SecurityGroupArgs.builder()
.name("tf-redis-sg")
.build());
var sgRule = new SecurityGroupLiteRule("sgRule", SecurityGroupLiteRuleArgs.builder()
.securityGroupId(securityGroup.securityGroupId())
.ingresses(
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"DROP#0.0.0.0/0#80-90#TCP")
.egresses(
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#10.0.0.0/8#ALL#ICMP",
"DROP#0.0.0.0/0#ALL#ALL")
.build());
var example = new RedisInstance("example", RedisInstanceArgs.builder()
.availabilityZone(zone.lists()[2].zone())
.typeId(zone.lists()[2].typeId())
.password("Password@123")
.memSize(8192.0)
.redisShardNum(zone.lists()[2].redisShardNums()[0])
.redisReplicasNum(2.0)
.replicaZoneIds(replicaZoneIds)
.name("tf-example")
.port(6379.0)
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.securityGroups(securityGroup.securityGroupId())
.build());
}
}
configuration:
replicaZoneIds:
type: dynamic
default:
- 100004
- 100006
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
name: tf_redis_vpc
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${zone.lists[2].zone}
name: tf_redis_subnet
cidrBlock: 10.0.1.0/24
securityGroup:
type: tencentcloud:SecurityGroup
name: security_group
properties:
name: tf-redis-sg
sgRule:
type: tencentcloud:SecurityGroupLiteRule
name: sg_rule
properties:
securityGroupId: ${securityGroup.securityGroupId}
ingresses:
- ACCEPT#192.168.1.0/24#80#TCP
- DROP#8.8.8.8#80,90#UDP
- DROP#0.0.0.0/0#80-90#TCP
egresses:
- ACCEPT#192.168.0.0/16#ALL#TCP
- ACCEPT#10.0.0.0/8#ALL#ICMP
- DROP#0.0.0.0/0#ALL#ALL
example:
type: tencentcloud:RedisInstance
properties:
availabilityZone: ${zone.lists[2].zone}
typeId: ${zone.lists[2].typeId}
password: Password@123
memSize: 8192
redisShardNum: ${zone.lists[2].redisShardNums[0]}
redisReplicasNum: 2
replicaZoneIds: ${replicaZoneIds}
name: tf-example
port: 6379
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
securityGroups:
- ${securityGroup.securityGroupId}
variables:
zone:
fn::invoke:
function: tencentcloud:getRedisZoneConfig
arguments:
typeId: 7
region: ap-guangzhou
Create a memcached instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zone = tencentcloud.getRedisZoneConfig({
typeId: 200,
region: "ap-guangzhou",
});
const config = new pulumi.Config();
const replicaZoneIds = config.getObject<any>("replicaZoneIds") || [
100004,
100006,
];
const vpc = new tencentcloud.Vpc("vpc", {
cidrBlock: "10.0.0.0/16",
name: "tf_redis_vpc",
});
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: zone.then(zone => zone.lists?.[2]?.zone),
name: "tf_redis_subnet",
cidrBlock: "10.0.1.0/24",
});
const securityGroup = new tencentcloud.SecurityGroup("security_group", {name: "tf-redis-sg"});
const sgRule = new tencentcloud.SecurityGroupRuleSet("sg_rule", {
securityGroupId: securityGroup.securityGroupId,
ingresses: [
{
action: "ACCEPT",
cidrBlock: "10.0.0.0/22",
protocol: "TCP",
port: "80-90",
description: "A:Allow Ips and 80-90",
},
{
action: "ACCEPT",
cidrBlock: "10.0.2.1",
protocol: "UDP",
port: "8080",
description: "B:Allow UDP 8080",
},
],
egresses: [
{
action: "DROP",
cidrBlock: "10.0.0.0/16",
protocol: "ICMP",
description: "A:Block ping3",
},
{
action: "DROP",
cidrBlock: "0.0.0.0/0",
protocol: "ALL",
description: "A:Block ping3",
},
],
});
const example = new tencentcloud.RedisInstance("example", {
availabilityZone: zone.then(zone => zone.lists?.[2]?.zone),
typeId: zone.then(zone => zone.lists?.[2]?.typeId),
memSize: 8192,
redisShardNum: zone.then(zone => zone.lists?.[2]?.redisShardNums?.[0]),
redisReplicasNum: 2,
noAuth: true,
replicaZoneIds: replicaZoneIds,
name: "tf-example",
port: 6379,
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
securityGroups: [securityGroup.securityGroupId],
forceDelete: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zone = tencentcloud.get_redis_zone_config(type_id=200,
region="ap-guangzhou")
config = pulumi.Config()
replica_zone_ids = config.get_object("replicaZoneIds")
if replica_zone_ids is None:
replica_zone_ids = [
100004,
100006,
]
vpc = tencentcloud.Vpc("vpc",
cidr_block="10.0.0.0/16",
name="tf_redis_vpc")
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=zone.lists[2].zone,
name="tf_redis_subnet",
cidr_block="10.0.1.0/24")
security_group = tencentcloud.SecurityGroup("security_group", name="tf-redis-sg")
sg_rule = tencentcloud.SecurityGroupRuleSet("sg_rule",
security_group_id=security_group.security_group_id,
ingresses=[
{
"action": "ACCEPT",
"cidr_block": "10.0.0.0/22",
"protocol": "TCP",
"port": "80-90",
"description": "A:Allow Ips and 80-90",
},
{
"action": "ACCEPT",
"cidr_block": "10.0.2.1",
"protocol": "UDP",
"port": "8080",
"description": "B:Allow UDP 8080",
},
],
egresses=[
{
"action": "DROP",
"cidr_block": "10.0.0.0/16",
"protocol": "ICMP",
"description": "A:Block ping3",
},
{
"action": "DROP",
"cidr_block": "0.0.0.0/0",
"protocol": "ALL",
"description": "A:Block ping3",
},
])
example = tencentcloud.RedisInstance("example",
availability_zone=zone.lists[2].zone,
type_id=zone.lists[2].type_id,
mem_size=8192,
redis_shard_num=zone.lists[2].redis_shard_nums[0],
redis_replicas_num=2,
no_auth=True,
replica_zone_ids=replica_zone_ids,
name="tf-example",
port=6379,
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
security_groups=[security_group.security_group_id],
force_delete=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
zone, err := tencentcloud.GetRedisZoneConfig(ctx, &tencentcloud.GetRedisZoneConfigArgs{
TypeId: pulumi.Float64Ref(200),
Region: pulumi.StringRef("ap-guangzhou"),
}, nil)
if err != nil {
return err
}
cfg := config.New(ctx, "")
replicaZoneIds := []float64{
100004,
100006,
}
if param := cfg.GetObject("replicaZoneIds"); param != nil {
replicaZoneIds = param
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
Name: pulumi.String("tf_redis_vpc"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(zone.Lists[2].Zone),
Name: pulumi.String("tf_redis_subnet"),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
securityGroup, err := tencentcloud.NewSecurityGroup(ctx, "security_group", &tencentcloud.SecurityGroupArgs{
Name: pulumi.String("tf-redis-sg"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewSecurityGroupRuleSet(ctx, "sg_rule", &tencentcloud.SecurityGroupRuleSetArgs{
SecurityGroupId: securityGroup.SecurityGroupId,
Ingresses: tencentcloud.SecurityGroupRuleSetIngressArray{
&tencentcloud.SecurityGroupRuleSetIngressArgs{
Action: pulumi.String("ACCEPT"),
CidrBlock: pulumi.String("10.0.0.0/22"),
Protocol: pulumi.String("TCP"),
Port: pulumi.String("80-90"),
Description: pulumi.String("A:Allow Ips and 80-90"),
},
&tencentcloud.SecurityGroupRuleSetIngressArgs{
Action: pulumi.String("ACCEPT"),
CidrBlock: pulumi.String("10.0.2.1"),
Protocol: pulumi.String("UDP"),
Port: pulumi.String("8080"),
Description: pulumi.String("B:Allow UDP 8080"),
},
},
Egresses: tencentcloud.SecurityGroupRuleSetEgressArray{
&tencentcloud.SecurityGroupRuleSetEgressArgs{
Action: pulumi.String("DROP"),
CidrBlock: pulumi.String("10.0.0.0/16"),
Protocol: pulumi.String("ICMP"),
Description: pulumi.String("A:Block ping3"),
},
&tencentcloud.SecurityGroupRuleSetEgressArgs{
Action: pulumi.String("DROP"),
CidrBlock: pulumi.String("0.0.0.0/0"),
Protocol: pulumi.String("ALL"),
Description: pulumi.String("A:Block ping3"),
},
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewRedisInstance(ctx, "example", &tencentcloud.RedisInstanceArgs{
AvailabilityZone: pulumi.String(zone.Lists[2].Zone),
TypeId: pulumi.Float64(zone.Lists[2].TypeId),
MemSize: pulumi.Float64(8192),
RedisShardNum: pulumi.Float64(zone.Lists[2].RedisShardNums[0]),
RedisReplicasNum: pulumi.Float64(2),
NoAuth: pulumi.Bool(true),
ReplicaZoneIds: pulumi.Any(replicaZoneIds),
Name: pulumi.String("tf-example"),
Port: pulumi.Float64(6379),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
SecurityGroups: pulumi.StringArray{
securityGroup.SecurityGroupId,
},
ForceDelete: pulumi.Bool(true),
})
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 zone = Tencentcloud.GetRedisZoneConfig.Invoke(new()
{
TypeId = 200,
Region = "ap-guangzhou",
});
var config = new Config();
var replicaZoneIds = config.GetObject<dynamic>("replicaZoneIds") ?? new[]
{
100004,
100006,
};
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
Name = "tf_redis_vpc",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.Zone),
Name = "tf_redis_subnet",
CidrBlock = "10.0.1.0/24",
});
var securityGroup = new Tencentcloud.SecurityGroup("security_group", new()
{
Name = "tf-redis-sg",
});
var sgRule = new Tencentcloud.SecurityGroupRuleSet("sg_rule", new()
{
SecurityGroupId = securityGroup.SecurityGroupId,
Ingresses = new[]
{
new Tencentcloud.Inputs.SecurityGroupRuleSetIngressArgs
{
Action = "ACCEPT",
CidrBlock = "10.0.0.0/22",
Protocol = "TCP",
Port = "80-90",
Description = "A:Allow Ips and 80-90",
},
new Tencentcloud.Inputs.SecurityGroupRuleSetIngressArgs
{
Action = "ACCEPT",
CidrBlock = "10.0.2.1",
Protocol = "UDP",
Port = "8080",
Description = "B:Allow UDP 8080",
},
},
Egresses = new[]
{
new Tencentcloud.Inputs.SecurityGroupRuleSetEgressArgs
{
Action = "DROP",
CidrBlock = "10.0.0.0/16",
Protocol = "ICMP",
Description = "A:Block ping3",
},
new Tencentcloud.Inputs.SecurityGroupRuleSetEgressArgs
{
Action = "DROP",
CidrBlock = "0.0.0.0/0",
Protocol = "ALL",
Description = "A:Block ping3",
},
},
});
var example = new Tencentcloud.RedisInstance("example", new()
{
AvailabilityZone = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.Zone),
TypeId = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.TypeId),
MemSize = 8192,
RedisShardNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[2]?.RedisShardNums[0]),
RedisReplicasNum = 2,
NoAuth = true,
ReplicaZoneIds = replicaZoneIds,
Name = "tf-example",
Port = 6379,
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
SecurityGroups = new[]
{
securityGroup.SecurityGroupId,
},
ForceDelete = true,
});
});
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.GetRedisZoneConfigArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.SecurityGroup;
import com.pulumi.tencentcloud.SecurityGroupArgs;
import com.pulumi.tencentcloud.SecurityGroupRuleSet;
import com.pulumi.tencentcloud.SecurityGroupRuleSetArgs;
import com.pulumi.tencentcloud.inputs.SecurityGroupRuleSetIngressArgs;
import com.pulumi.tencentcloud.inputs.SecurityGroupRuleSetEgressArgs;
import com.pulumi.tencentcloud.RedisInstance;
import com.pulumi.tencentcloud.RedisInstanceArgs;
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 config = ctx.config();
final var zone = TencentcloudFunctions.getRedisZoneConfig(GetRedisZoneConfigArgs.builder()
.typeId(200)
.region("ap-guangzhou")
.build());
final var replicaZoneIds = config.get("replicaZoneIds").orElse(List.of(
100004,
100006));
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.name("tf_redis_vpc")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(zone.lists()[2].zone())
.name("tf_redis_subnet")
.cidrBlock("10.0.1.0/24")
.build());
var securityGroup = new SecurityGroup("securityGroup", SecurityGroupArgs.builder()
.name("tf-redis-sg")
.build());
var sgRule = new SecurityGroupRuleSet("sgRule", SecurityGroupRuleSetArgs.builder()
.securityGroupId(securityGroup.securityGroupId())
.ingresses(
SecurityGroupRuleSetIngressArgs.builder()
.action("ACCEPT")
.cidrBlock("10.0.0.0/22")
.protocol("TCP")
.port("80-90")
.description("A:Allow Ips and 80-90")
.build(),
SecurityGroupRuleSetIngressArgs.builder()
.action("ACCEPT")
.cidrBlock("10.0.2.1")
.protocol("UDP")
.port("8080")
.description("B:Allow UDP 8080")
.build())
.egresses(
SecurityGroupRuleSetEgressArgs.builder()
.action("DROP")
.cidrBlock("10.0.0.0/16")
.protocol("ICMP")
.description("A:Block ping3")
.build(),
SecurityGroupRuleSetEgressArgs.builder()
.action("DROP")
.cidrBlock("0.0.0.0/0")
.protocol("ALL")
.description("A:Block ping3")
.build())
.build());
var example = new RedisInstance("example", RedisInstanceArgs.builder()
.availabilityZone(zone.lists()[2].zone())
.typeId(zone.lists()[2].typeId())
.memSize(8192.0)
.redisShardNum(zone.lists()[2].redisShardNums()[0])
.redisReplicasNum(2.0)
.noAuth(true)
.replicaZoneIds(replicaZoneIds)
.name("tf-example")
.port(6379.0)
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.securityGroups(securityGroup.securityGroupId())
.forceDelete(true)
.build());
}
}
configuration:
replicaZoneIds:
type: dynamic
default:
- 100004
- 100006
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
name: tf_redis_vpc
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${zone.lists[2].zone}
name: tf_redis_subnet
cidrBlock: 10.0.1.0/24
securityGroup:
type: tencentcloud:SecurityGroup
name: security_group
properties:
name: tf-redis-sg
sgRule:
type: tencentcloud:SecurityGroupRuleSet
name: sg_rule
properties:
securityGroupId: ${securityGroup.securityGroupId}
ingresses:
- action: ACCEPT
cidrBlock: 10.0.0.0/22
protocol: TCP
port: 80-90
description: A:Allow Ips and 80-90
- action: ACCEPT
cidrBlock: 10.0.2.1
protocol: UDP
port: '8080'
description: B:Allow UDP 8080
egresses:
- action: DROP
cidrBlock: 10.0.0.0/16
protocol: ICMP
description: A:Block ping3
- action: DROP
cidrBlock: 0.0.0.0/0
protocol: ALL
description: A:Block ping3
example:
type: tencentcloud:RedisInstance
properties:
availabilityZone: ${zone.lists[2].zone}
typeId: ${zone.lists[2].typeId}
memSize: 8192
redisShardNum: ${zone.lists[2].redisShardNums[0]}
redisReplicasNum: 2
noAuth: true
replicaZoneIds: ${replicaZoneIds}
name: tf-example
port: 6379
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
securityGroups:
- ${securityGroup.securityGroupId}
forceDelete: true
variables:
zone:
fn::invoke:
function: tencentcloud:getRedisZoneConfig
arguments:
typeId: 200
region: ap-guangzhou
Create a CDC scenario instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const cdcId = config.get("cdcId") || "cluster-262n63e8";
const cdcRegion = config.get("cdcRegion") || "ap-guangzhou";
const clusters = tencentcloud.getRedisClusters({
dedicatedClusterId: cdcId,
});
export const name = clusters.then(clusters => clusters.resources?.[0]?.redisClusterId);
const zone = tencentcloud.getRedisZoneConfig({
typeId: 7,
region: cdcRegion,
});
const example = tencentcloud.getCdcDedicatedClusters({
dedicatedClusterIds: [cdcId],
});
const subnets = tencentcloud.getVpcSubnets({
cdcId: cdcId,
});
const exampleRedisInstance = new tencentcloud.RedisInstance("example", {
availabilityZone: example.then(example => example.dedicatedClusterSets?.[0]?.zone),
typeId: zone.then(zone => zone.lists?.[0]?.typeId),
password: "Password@123",
memSize: 8192,
redisShardNum: zone.then(zone => zone.lists?.[0]?.redisShardNums?.[0]),
redisReplicasNum: zone.then(zone => zone.lists?.[0]?.redisReplicasNums?.[0]),
name: "tf-cdc-example",
port: 6379,
vpcId: subnets.then(subnets => subnets.instanceLists?.[0]?.vpcId),
subnetId: subnets.then(subnets => subnets.instanceLists?.[0]?.subnetId),
productVersion: "cdc",
redisClusterId: clusters.then(clusters => clusters.resources?.[0]?.redisClusterId),
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
cdc_id = config.get("cdcId")
if cdc_id is None:
cdc_id = "cluster-262n63e8"
cdc_region = config.get("cdcRegion")
if cdc_region is None:
cdc_region = "ap-guangzhou"
clusters = tencentcloud.get_redis_clusters(dedicated_cluster_id=cdc_id)
pulumi.export("name", clusters.resources[0].redis_cluster_id)
zone = tencentcloud.get_redis_zone_config(type_id=7,
region=cdc_region)
example = tencentcloud.get_cdc_dedicated_clusters(dedicated_cluster_ids=[cdc_id])
subnets = tencentcloud.get_vpc_subnets(cdc_id=cdc_id)
example_redis_instance = tencentcloud.RedisInstance("example",
availability_zone=example.dedicated_cluster_sets[0].zone,
type_id=zone.lists[0].type_id,
password="Password@123",
mem_size=8192,
redis_shard_num=zone.lists[0].redis_shard_nums[0],
redis_replicas_num=zone.lists[0].redis_replicas_nums[0],
name="tf-cdc-example",
port=6379,
vpc_id=subnets.instance_lists[0].vpc_id,
subnet_id=subnets.instance_lists[0].subnet_id,
product_version="cdc",
redis_cluster_id=clusters.resources[0].redis_cluster_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
cdcId := "cluster-262n63e8"
if param := cfg.Get("cdcId"); param != "" {
cdcId = param
}
cdcRegion := "ap-guangzhou"
if param := cfg.Get("cdcRegion"); param != "" {
cdcRegion = param
}
clusters, err := tencentcloud.GetRedisClusters(ctx, &tencentcloud.GetRedisClustersArgs{
DedicatedClusterId: pulumi.StringRef(cdcId),
}, nil)
if err != nil {
return err
}
ctx.Export("name", clusters.Resources[0].RedisClusterId)
zone, err := tencentcloud.GetRedisZoneConfig(ctx, &tencentcloud.GetRedisZoneConfigArgs{
TypeId: pulumi.Float64Ref(7),
Region: pulumi.StringRef(cdcRegion),
}, nil)
if err != nil {
return err
}
example, err := tencentcloud.GetCdcDedicatedClusters(ctx, &tencentcloud.GetCdcDedicatedClustersArgs{
DedicatedClusterIds: []string{
cdcId,
},
}, nil)
if err != nil {
return err
}
subnets, err := tencentcloud.GetVpcSubnets(ctx, &tencentcloud.GetVpcSubnetsArgs{
CdcId: pulumi.StringRef(cdcId),
}, nil)
if err != nil {
return err
}
_, err = tencentcloud.NewRedisInstance(ctx, "example", &tencentcloud.RedisInstanceArgs{
AvailabilityZone: pulumi.String(example.DedicatedClusterSets[0].Zone),
TypeId: pulumi.Float64(zone.Lists[0].TypeId),
Password: pulumi.String("Password@123"),
MemSize: pulumi.Float64(8192),
RedisShardNum: pulumi.Float64(zone.Lists[0].RedisShardNums[0]),
RedisReplicasNum: pulumi.Float64(zone.Lists[0].RedisReplicasNums[0]),
Name: pulumi.String("tf-cdc-example"),
Port: pulumi.Float64(6379),
VpcId: pulumi.String(subnets.InstanceLists[0].VpcId),
SubnetId: pulumi.String(subnets.InstanceLists[0].SubnetId),
ProductVersion: pulumi.String("cdc"),
RedisClusterId: pulumi.String(clusters.Resources[0].RedisClusterId),
})
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 config = new Config();
var cdcId = config.Get("cdcId") ?? "cluster-262n63e8";
var cdcRegion = config.Get("cdcRegion") ?? "ap-guangzhou";
var clusters = Tencentcloud.GetRedisClusters.Invoke(new()
{
DedicatedClusterId = cdcId,
});
var zone = Tencentcloud.GetRedisZoneConfig.Invoke(new()
{
TypeId = 7,
Region = cdcRegion,
});
var example = Tencentcloud.GetCdcDedicatedClusters.Invoke(new()
{
DedicatedClusterIds = new[]
{
cdcId,
},
});
var subnets = Tencentcloud.GetVpcSubnets.Invoke(new()
{
CdcId = cdcId,
});
var exampleRedisInstance = new Tencentcloud.RedisInstance("example", new()
{
AvailabilityZone = example.Apply(getCdcDedicatedClustersResult => getCdcDedicatedClustersResult.DedicatedClusterSets[0]?.Zone),
TypeId = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.TypeId),
Password = "Password@123",
MemSize = 8192,
RedisShardNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisShardNums[0]),
RedisReplicasNum = zone.Apply(getRedisZoneConfigResult => getRedisZoneConfigResult.Lists[0]?.RedisReplicasNums[0]),
Name = "tf-cdc-example",
Port = 6379,
VpcId = subnets.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.VpcId),
SubnetId = subnets.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.SubnetId),
ProductVersion = "cdc",
RedisClusterId = clusters.Apply(getRedisClustersResult => getRedisClustersResult.Resources[0]?.RedisClusterId),
});
return new Dictionary<string, object?>
{
["name"] = clusters.Apply(getRedisClustersResult => getRedisClustersResult.Resources[0]?.RedisClusterId),
};
});
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.GetRedisClustersArgs;
import com.pulumi.tencentcloud.inputs.GetRedisZoneConfigArgs;
import com.pulumi.tencentcloud.inputs.GetCdcDedicatedClustersArgs;
import com.pulumi.tencentcloud.inputs.GetVpcSubnetsArgs;
import com.pulumi.tencentcloud.RedisInstance;
import com.pulumi.tencentcloud.RedisInstanceArgs;
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 config = ctx.config();
final var cdcId = config.get("cdcId").orElse("cluster-262n63e8");
final var cdcRegion = config.get("cdcRegion").orElse("ap-guangzhou");
final var clusters = TencentcloudFunctions.getRedisClusters(GetRedisClustersArgs.builder()
.dedicatedClusterId(cdcId)
.build());
ctx.export("name", clusters.resources()[0].redisClusterId());
final var zone = TencentcloudFunctions.getRedisZoneConfig(GetRedisZoneConfigArgs.builder()
.typeId(7)
.region(cdcRegion)
.build());
final var example = TencentcloudFunctions.getCdcDedicatedClusters(GetCdcDedicatedClustersArgs.builder()
.dedicatedClusterIds(cdcId)
.build());
final var subnets = TencentcloudFunctions.getVpcSubnets(GetVpcSubnetsArgs.builder()
.cdcId(cdcId)
.build());
var exampleRedisInstance = new RedisInstance("exampleRedisInstance", RedisInstanceArgs.builder()
.availabilityZone(example.dedicatedClusterSets()[0].zone())
.typeId(zone.lists()[0].typeId())
.password("Password@123")
.memSize(8192.0)
.redisShardNum(zone.lists()[0].redisShardNums()[0])
.redisReplicasNum(zone.lists()[0].redisReplicasNums()[0])
.name("tf-cdc-example")
.port(6379.0)
.vpcId(subnets.instanceLists()[0].vpcId())
.subnetId(subnets.instanceLists()[0].subnetId())
.productVersion("cdc")
.redisClusterId(clusters.resources()[0].redisClusterId())
.build());
}
}
configuration:
cdcId:
type: string
default: cluster-262n63e8
cdcRegion:
type: string
default: ap-guangzhou
resources:
exampleRedisInstance:
type: tencentcloud:RedisInstance
name: example
properties:
availabilityZone: ${example.dedicatedClusterSets[0].zone}
typeId: ${zone.lists[0].typeId}
password: Password@123
memSize: 8192
redisShardNum: ${zone.lists[0].redisShardNums[0]}
redisReplicasNum: ${zone.lists[0].redisReplicasNums[0]}
name: tf-cdc-example
port: 6379
vpcId: ${subnets.instanceLists[0].vpcId}
subnetId: ${subnets.instanceLists[0].subnetId}
productVersion: cdc
redisClusterId: ${clusters.resources[0].redisClusterId}
variables:
clusters:
fn::invoke:
function: tencentcloud:getRedisClusters
arguments:
dedicatedClusterId: ${cdcId}
zone:
fn::invoke:
function: tencentcloud:getRedisZoneConfig
arguments:
typeId: 7
region: ${cdcRegion}
example:
fn::invoke:
function: tencentcloud:getCdcDedicatedClusters
arguments:
dedicatedClusterIds:
- ${cdcId}
subnets:
fn::invoke:
function: tencentcloud:getVpcSubnets
arguments:
cdcId: ${cdcId}
outputs:
name: ${clusters.resources[0].redisClusterId}
Create RedisInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RedisInstance(name: string, args: RedisInstanceArgs, opts?: CustomResourceOptions);@overload
def RedisInstance(resource_name: str,
args: RedisInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RedisInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
mem_size: Optional[float] = None,
availability_zone: Optional[str] = None,
project_id: Optional[float] = None,
type: Optional[str] = None,
ip: Optional[str] = None,
charge_type: Optional[str] = None,
redis_cluster_id: Optional[str] = None,
no_auth: Optional[bool] = None,
operation_network: Optional[str] = None,
params_template_id: Optional[str] = None,
password: Optional[str] = None,
port: Optional[float] = None,
prepaid_period: Optional[float] = None,
product_version: Optional[str] = None,
force_delete: Optional[bool] = None,
auto_renew_flag: Optional[float] = None,
name: Optional[str] = None,
redis_instance_id: Optional[str] = None,
redis_replicas_num: Optional[float] = None,
redis_shard_num: Optional[float] = None,
replica_zone_ids: Optional[Sequence[float]] = None,
replicas_read_only: Optional[bool] = None,
security_groups: Optional[Sequence[str]] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
recycle: Optional[float] = None,
type_id: Optional[float] = None,
vpc_id: Optional[str] = None,
wait_switch: Optional[float] = None,
wan_address_switch: Optional[str] = None)func NewRedisInstance(ctx *Context, name string, args RedisInstanceArgs, opts ...ResourceOption) (*RedisInstance, error)public RedisInstance(string name, RedisInstanceArgs args, CustomResourceOptions? opts = null)
public RedisInstance(String name, RedisInstanceArgs args)
public RedisInstance(String name, RedisInstanceArgs args, CustomResourceOptions options)
type: tencentcloud:RedisInstance
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RedisInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RedisInstanceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RedisInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RedisInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RedisInstanceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RedisInstance Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RedisInstance resource accepts the following input properties:
- Availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - Mem
Size double - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - Auto
Renew doubleFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- Charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - Force
Delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- Ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - Name string
- Instance name.
- No
Auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- Operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - Params
Template stringId - Specify params template id. If not set, will use default template.
- Password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - Port double
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - Prepaid
Period double - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - Product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - Project
Id double - Specifies which project the instance should belong to.
- Recycle double
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - Redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - Redis
Instance stringId - ID of the master or replica node.
- Redis
Replicas doubleNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - Redis
Shard doubleNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - Replica
Zone List<double>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- Replicas
Read boolOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- Security
Groups List<string> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- Subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Dictionary<string, string>
- Instance tags.
- Type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - Type
Id double - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - Vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Wait
Switch double - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - Wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- Availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - Mem
Size float64 - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - Auto
Renew float64Flag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- Charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - Force
Delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- Ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - Name string
- Instance name.
- No
Auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- Operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - Params
Template stringId - Specify params template id. If not set, will use default template.
- Password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - Port float64
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - Prepaid
Period float64 - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - Product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - Project
Id float64 - Specifies which project the instance should belong to.
- Recycle float64
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - Redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - Redis
Instance stringId - ID of the master or replica node.
- Redis
Replicas float64Num - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - Redis
Shard float64Num - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - Replica
Zone []float64Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- Replicas
Read boolOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- Security
Groups []string - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- Subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - map[string]string
- Instance tags.
- Type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - Type
Id float64 - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - Vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Wait
Switch float64 - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - Wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- availability
Zone String - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - mem
Size Double - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - auto
Renew DoubleFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- charge
Type String - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - force
Delete Boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip String
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - name String
- Instance name.
- no
Auth Boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- operation
Network String - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template StringId - Specify params template id. If not set, will use default template.
- password String
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port Double
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period Double - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version String - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id Double - Specifies which project the instance should belong to.
- recycle Double
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster StringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance StringId - ID of the master or replica node.
- redis
Replicas DoubleNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard DoubleNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone List<Double>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read BooleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups List<String> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- subnet
Id String - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Map<String,String>
- Instance tags.
- type String
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id Double - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id String - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch Double - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address StringSwitch - Wan address switch, default
close, values:open,close.
- availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - mem
Size number - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - auto
Renew numberFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - force
Delete boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - name string
- Instance name.
- no
Auth boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template stringId - Specify params template id. If not set, will use default template.
- password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port number
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period number - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id number - Specifies which project the instance should belong to.
- recycle number
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance stringId - ID of the master or replica node.
- redis
Replicas numberNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard numberNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone number[]Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read booleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups string[] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - {[key: string]: string}
- Instance tags.
- type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id number - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch number - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- availability_
zone str - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - mem_
size float - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - auto_
renew_ floatflag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- charge_
type str - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - force_
delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip str
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - name str
- Instance name.
- no_
auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- operation_
network str - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params_
template_ strid - Specify params template id. If not set, will use default template.
- password str
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port float
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid_
period float - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product_
version str - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project_
id float - Specifies which project the instance should belong to.
- recycle float
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis_
cluster_ strid - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis_
instance_ strid - ID of the master or replica node.
- redis_
replicas_ floatnum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis_
shard_ floatnum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica_
zone_ Sequence[float]ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas_
read_ boolonly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security_
groups Sequence[str] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- subnet_
id str - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Mapping[str, str]
- Instance tags.
- type str
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type_
id float - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc_
id str - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait_
switch float - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan_
address_ strswitch - Wan address switch, default
close, values:open,close.
- availability
Zone String - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - mem
Size Number - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - auto
Renew NumberFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- charge
Type String - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - force
Delete Boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip String
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - name String
- Instance name.
- no
Auth Boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- operation
Network String - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template StringId - Specify params template id. If not set, will use default template.
- password String
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port Number
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period Number - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version String - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id Number - Specifies which project the instance should belong to.
- recycle Number
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster StringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance StringId - ID of the master or replica node.
- redis
Replicas NumberNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard NumberNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone List<Number>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read BooleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups List<String> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- subnet
Id String - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Map<String>
- Instance tags.
- type String
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id Number - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id String - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch Number - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address StringSwitch - Wan address switch, default
close, values:open,close.
Outputs
All input properties are implicitly available as output properties. Additionally, the RedisInstance resource produces the following output properties:
- Create
Time string - The time when the instance was created.
- Dedicated
Cluster stringId - Dedicated Cluster ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Node
Infos List<RedisInstance Node Info> - Readonly Primary/Replica nodes.
- Status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- Wan
Address string - Allocate Wan Address.
- Create
Time string - The time when the instance was created.
- Dedicated
Cluster stringId - Dedicated Cluster ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Node
Infos []RedisInstance Node Info - Readonly Primary/Replica nodes.
- Status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- Wan
Address string - Allocate Wan Address.
- create
Time String - The time when the instance was created.
- dedicated
Cluster StringId - Dedicated Cluster ID.
- id String
- The provider-assigned unique ID for this managed resource.
- node
Infos List<RedisInstance Node Info> - Readonly Primary/Replica nodes.
- status String
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- wan
Address String - Allocate Wan Address.
- create
Time string - The time when the instance was created.
- dedicated
Cluster stringId - Dedicated Cluster ID.
- id string
- The provider-assigned unique ID for this managed resource.
- node
Infos RedisInstance Node Info[] - Readonly Primary/Replica nodes.
- status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- wan
Address string - Allocate Wan Address.
- create_
time str - The time when the instance was created.
- dedicated_
cluster_ strid - Dedicated Cluster ID.
- id str
- The provider-assigned unique ID for this managed resource.
- node_
infos Sequence[RedisInstance Node Info] - Readonly Primary/Replica nodes.
- status str
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- wan_
address str - Allocate Wan Address.
- create
Time String - The time when the instance was created.
- dedicated
Cluster StringId - Dedicated Cluster ID.
- id String
- The provider-assigned unique ID for this managed resource.
- node
Infos List<Property Map> - Readonly Primary/Replica nodes.
- status String
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- wan
Address String - Allocate Wan Address.
Look up Existing RedisInstance Resource
Get an existing RedisInstance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RedisInstanceState, opts?: CustomResourceOptions): RedisInstance@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_renew_flag: Optional[float] = None,
availability_zone: Optional[str] = None,
charge_type: Optional[str] = None,
create_time: Optional[str] = None,
dedicated_cluster_id: Optional[str] = None,
force_delete: Optional[bool] = None,
ip: Optional[str] = None,
mem_size: Optional[float] = None,
name: Optional[str] = None,
no_auth: Optional[bool] = None,
node_infos: Optional[Sequence[RedisInstanceNodeInfoArgs]] = None,
operation_network: Optional[str] = None,
params_template_id: Optional[str] = None,
password: Optional[str] = None,
port: Optional[float] = None,
prepaid_period: Optional[float] = None,
product_version: Optional[str] = None,
project_id: Optional[float] = None,
recycle: Optional[float] = None,
redis_cluster_id: Optional[str] = None,
redis_instance_id: Optional[str] = None,
redis_replicas_num: Optional[float] = None,
redis_shard_num: Optional[float] = None,
replica_zone_ids: Optional[Sequence[float]] = None,
replicas_read_only: Optional[bool] = None,
security_groups: Optional[Sequence[str]] = None,
status: Optional[str] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
type: Optional[str] = None,
type_id: Optional[float] = None,
vpc_id: Optional[str] = None,
wait_switch: Optional[float] = None,
wan_address: Optional[str] = None,
wan_address_switch: Optional[str] = None) -> RedisInstancefunc GetRedisInstance(ctx *Context, name string, id IDInput, state *RedisInstanceState, opts ...ResourceOption) (*RedisInstance, error)public static RedisInstance Get(string name, Input<string> id, RedisInstanceState? state, CustomResourceOptions? opts = null)public static RedisInstance get(String name, Output<String> id, RedisInstanceState state, CustomResourceOptions options)resources: _: type: tencentcloud:RedisInstance get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Auto
Renew doubleFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- Availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - Charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - Create
Time string - The time when the instance was created.
- Dedicated
Cluster stringId - Dedicated Cluster ID.
- Force
Delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- Ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - Mem
Size double - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - Name string
- Instance name.
- No
Auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- Node
Infos List<RedisInstance Node Info> - Readonly Primary/Replica nodes.
- Operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - Params
Template stringId - Specify params template id. If not set, will use default template.
- Password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - Port double
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - Prepaid
Period double - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - Product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - Project
Id double - Specifies which project the instance should belong to.
- Recycle double
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - Redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - Redis
Instance stringId - ID of the master or replica node.
- Redis
Replicas doubleNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - Redis
Shard doubleNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - Replica
Zone List<double>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- Replicas
Read boolOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- Security
Groups List<string> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- Status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- Subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Dictionary<string, string>
- Instance tags.
- Type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - Type
Id double - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - Vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Wait
Switch double - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - Wan
Address string - Allocate Wan Address.
- Wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- Auto
Renew float64Flag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- Availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - Charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - Create
Time string - The time when the instance was created.
- Dedicated
Cluster stringId - Dedicated Cluster ID.
- Force
Delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- Ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - Mem
Size float64 - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - Name string
- Instance name.
- No
Auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- Node
Infos []RedisInstance Node Info Args - Readonly Primary/Replica nodes.
- Operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - Params
Template stringId - Specify params template id. If not set, will use default template.
- Password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - Port float64
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - Prepaid
Period float64 - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - Product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - Project
Id float64 - Specifies which project the instance should belong to.
- Recycle float64
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - Redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - Redis
Instance stringId - ID of the master or replica node.
- Redis
Replicas float64Num - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - Redis
Shard float64Num - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - Replica
Zone []float64Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- Replicas
Read boolOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- Security
Groups []string - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- Status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- Subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - map[string]string
- Instance tags.
- Type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - Type
Id float64 - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - Vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Wait
Switch float64 - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - Wan
Address string - Allocate Wan Address.
- Wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- auto
Renew DoubleFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- availability
Zone String - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - charge
Type String - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - create
Time String - The time when the instance was created.
- dedicated
Cluster StringId - Dedicated Cluster ID.
- force
Delete Boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip String
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - mem
Size Double - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - name String
- Instance name.
- no
Auth Boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- node
Infos List<RedisInstance Node Info> - Readonly Primary/Replica nodes.
- operation
Network String - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template StringId - Specify params template id. If not set, will use default template.
- password String
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port Double
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period Double - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version String - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id Double - Specifies which project the instance should belong to.
- recycle Double
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster StringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance StringId - ID of the master or replica node.
- redis
Replicas DoubleNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard DoubleNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone List<Double>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read BooleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups List<String> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- status String
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- subnet
Id String - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Map<String,String>
- Instance tags.
- type String
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id Double - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id String - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch Double - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address String - Allocate Wan Address.
- wan
Address StringSwitch - Wan address switch, default
close, values:open,close.
- auto
Renew numberFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- availability
Zone string - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - charge
Type string - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - create
Time string - The time when the instance was created.
- dedicated
Cluster stringId - Dedicated Cluster ID.
- force
Delete boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip string
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - mem
Size number - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - name string
- Instance name.
- no
Auth boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- node
Infos RedisInstance Node Info[] - Readonly Primary/Replica nodes.
- operation
Network string - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template stringId - Specify params template id. If not set, will use default template.
- password string
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port number
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period number - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version string - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id number - Specifies which project the instance should belong to.
- recycle number
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster stringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance stringId - ID of the master or replica node.
- redis
Replicas numberNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard numberNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone number[]Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read booleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups string[] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- status string
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- subnet
Id string - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - {[key: string]: string}
- Instance tags.
- type string
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id number - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id string - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch number - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address string - Allocate Wan Address.
- wan
Address stringSwitch - Wan address switch, default
close, values:open,close.
- auto_
renew_ floatflag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- availability_
zone str - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - charge_
type str - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - create_
time str - The time when the instance was created.
- dedicated_
cluster_ strid - Dedicated Cluster ID.
- force_
delete bool - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip str
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - mem_
size float - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - name str
- Instance name.
- no_
auth bool - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- node_
infos Sequence[RedisInstance Node Info Args] - Readonly Primary/Replica nodes.
- operation_
network str - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params_
template_ strid - Specify params template id. If not set, will use default template.
- password str
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port float
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid_
period float - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product_
version str - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project_
id float - Specifies which project the instance should belong to.
- recycle float
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis_
cluster_ strid - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis_
instance_ strid - ID of the master or replica node.
- redis_
replicas_ floatnum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis_
shard_ floatnum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica_
zone_ Sequence[float]ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas_
read_ boolonly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security_
groups Sequence[str] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- status str
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- subnet_
id str - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Mapping[str, str]
- Instance tags.
- type str
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type_
id float - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc_
id str - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait_
switch float - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan_
address str - Allocate Wan Address.
- wan_
address_ strswitch - Wan address switch, default
close, values:open,close.
- auto
Renew NumberFlag - Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
- availability
Zone String - The available zone of an instance to be created, like
ap-beijing-7, please refer totencentcloud_redis_zone_config.list. - charge
Type String - The charge type of instance. Valid values:
PREPAIDandPOSTPAID. Default value isPOSTPAID. Note: TencentCloud International only supportsPOSTPAID. Caution that update operation on this field will delete old instances and create new with new charge type. - create
Time String - The time when the instance was created.
- dedicated
Cluster StringId - Dedicated Cluster ID.
- force
Delete Boolean - Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
- ip String
- IP address of an instance. When the
operation_networkischangeVip, this parameter needs to be configured. - mem
Size Number - The memory volume of an available instance(in MB), please refer to
tencentcloud_redis_zone_config.list[zone].shard_memories. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding.512MBis supported only in master-slave instance. - name String
- Instance name.
- no
Auth Boolean - Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
- node
Infos List<Property Map> - Readonly Primary/Replica nodes.
- operation
Network String - Refers to the category of the pre-modified network, including:
changeVip: refers to switching the private network, including its intranet IPv4 address and port;changeVpc: refers to switching the subnet to which the private network belongs;changeBaseToVpc: refers to switching the basic network to a private network;changeVPort: refers to only modifying the instance network port. - params
Template StringId - Specify params template id. If not set, will use default template.
- password String
- Password for a Redis user, which should be 8 to 16 characters. NOTE: Only
no_auth=truespecified can make password empty. - port Number
- The port used to access a redis instance. The default value is 6379. When the
operation_networkischangeVPortorchangeVip, this parameter needs to be configured. - prepaid
Period Number - The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to
PREPAID. Valid values are1,2,3,4,5,6,7,8,9,10,11,12,24,36. - product
Version String - Specify the product version of the instance.
local: Local disk version,cloud: Cloud disk version,cdc: Exclusive cluster version. Default islocal. - project
Id Number - Specifies which project the instance should belong to.
- recycle Number
- Original intranet IPv4 address retention time: unit: day, value range:
0,1,2,3,7,15. - redis
Cluster StringId - Exclusive cluster ID. When the
product_versionis set tocdc, this parameter must be set. - redis
Instance StringId - ID of the master or replica node.
- redis
Replicas NumberNum - The number of instance copies. This is not required for standalone and master slave versions and must equal to count of
replica_zone_ids, Non-multi-AZ does not requirereplica_zone_ids; Redis memory version 4.0, 5.0, 6.2 standard architecture and cluster architecture support the number of copies in the range [1, 2, 3, 4, 5]; Redis 2.8 standard version and CKV standard version only support 1 copy. - redis
Shard NumberNum - The number of instance shards; this parameter does not need to be configured for standard version instances; for cluster version instances, the number of shards ranges from: [
1,3,5,8,12,16,24,32,40,48,64,80,96,128]. - replica
Zone List<Number>Ids - ID of replica nodes available zone. This is not required for standalone and master slave versions. NOTE: Removing some of the same zone of replicas (e.g. removing 100001 of [100001, 100001, 100002]) will pick the first hit to remove.
- replicas
Read BooleanOnly - Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
- security
Groups List<String> - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- status String
- Current status of an instance, maybe: init, processing, online, isolate and todelete.
- subnet
Id String - Specifies which subnet the instance should belong to. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - Map<String>
- Instance tags.
- type String
- It has been deprecated from version 1.33.1. Please use 'type_id' instead. Instance type. Available values:
cluster_ckv,cluster_redis5.0,cluster_redis,master_slave_ckv,master_slave_redis4.0,master_slave_redis5.0,master_slave_redis,standalone_redis, specific region support specific types, need to refer datatencentcloud.getRedisZoneConfig. - type
Id Number - Instance type. Available values reference data source
tencentcloud.getRedisZoneConfigor document, toggle immediately when modified.2: Redis 2.8 Memory Edition (standard architecture); 3: CKV 3.2 Memory Edition (standard architecture); 4: CKV 3.2 Memory Edition (cluster architecture); 6: Redis 4.0 Memory Edition (standard architecture); 7: Redis 4.0 Memory Edition (cluster architecture); 8: Redis 5.0 Memory Edition (standard architecture); 9: Redis 5.0 Memory Edition (cluster architecture); 15: Redis 6.2 Memory Edition (standard architecture); 16: Redis 6.2 Memory Edition (cluster architecture); 17: Redis 7.0 Memory Edition (standard architecture); 18: Redis 7.0 Memory Edition (cluster architecture). 200: Memcached 1.6 Memory Edition (cluster architecture). Note: The CKV version is currently used by existing users and is temporarily retained.. - vpc
Id String - ID of the vpc with which the instance is to be associated. When the
operation_networkischangeVpcorchangeBaseToVpc, this parameter needs to be configured. - wait
Switch Number - Switching mode:
1-maintenance time window switching,2-immediate switching, default value2. - wan
Address String - Allocate Wan Address.
- wan
Address StringSwitch - Wan address switch, default
close, values:open,close.
Supporting Types
RedisInstanceNodeInfo, RedisInstanceNodeInfoArgs
Import
Redis instance can be imported, e.g.
$ pulumi import tencentcloud:index/redisInstance:RedisInstance example crs-iu22tdrf
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
