tencentcloud.PostgresqlInstance
Explore with Pulumi AI
Use this resource to create postgresql instance.
Note: To update the charge type, please update the
charge_type
and specify theperiod
for the charging period. It only supports updating fromPOSTPAID_BY_HOUR
toPREPAID
, and theperiod
field only valid in that upgrading case.
Note: If no values are set for the parameters:
db_kernel_version
,db_major_version
andengine_version
, thenengine_version
is set to10.4
by default. Suggest using parameterdb_major_version
to create an instance
Note: If you need to upgrade the database version, Please use data source
tencentcloud.getPostgresqlDbVersions
to obtain the valid version value fordb_kernel_version
,db_major_version
andengine_version
. And when modifying,db_kernel_version
,db_major_version
andengine_version
must be set.
Note: If upgrade
db_kernel_version
, will synchronize the upgrade of the read-only instance version; If upgradedb_major_version
, cannot have read-only instances.
Example Usage
Create a postgresql instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-3";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create vpc subnet
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: availabilityZone,
vpcId: vpc.vpcId,
cidrBlock: "10.0.20.0/28",
isMulticast: false,
});
// create postgresql
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
dbMajorVersion: "10",
engineVersion: "10.23",
rootUser: "root123",
rootPassword: "Root123$",
charset: "UTF8",
projectId: 0,
cpu: 1,
memory: 2,
storage: 10,
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-3"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create vpc subnet
subnet = tencentcloud.Subnet("subnet",
availability_zone=availability_zone,
vpc_id=vpc.vpc_id,
cidr_block="10.0.20.0/28",
is_multicast=False)
# create postgresql
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
db_major_version="10",
engine_version="10.23",
root_user="root123",
root_password="Root123$",
charset="UTF8",
project_id=0,
cpu=1,
memory=2,
storage=10,
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-3"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
// create vpc
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// create vpc subnet
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(availabilityZone),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.20.0/28"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
// create postgresql
_, err = tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
DbMajorVersion: pulumi.String("10"),
EngineVersion: pulumi.String("10.23"),
RootUser: pulumi.String("root123"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("UTF8"),
ProjectId: pulumi.Float64(0),
Cpu: pulumi.Float64(1),
Memory: pulumi.Float64(2),
Storage: pulumi.Float64(10),
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
// create vpc
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
// create vpc subnet
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = availabilityZone,
VpcId = vpc.VpcId,
CidrBlock = "10.0.20.0/28",
IsMulticast = false,
});
// create postgresql
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
DbMajorVersion = "10",
EngineVersion = "10.23",
RootUser = "root123",
RootPassword = "Root123$",
Charset = "UTF8",
ProjectId = 0,
Cpu = 1,
Memory = 2,
Storage = 10,
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-3");
// create vpc
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// create vpc subnet
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(availabilityZone)
.vpcId(vpc.vpcId())
.cidrBlock("10.0.20.0/28")
.isMulticast(false)
.build());
// create postgresql
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.dbMajorVersion("10")
.engineVersion("10.23")
.rootUser("root123")
.rootPassword("Root123$")
.charset("UTF8")
.projectId(0)
.cpu(1)
.memory(2)
.storage(10)
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-3
resources:
# create vpc
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
# create vpc subnet
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${availabilityZone}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.20.0/28
isMulticast: false
# create postgresql
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
dbMajorVersion: '10'
engineVersion: '10.23'
rootUser: root123
rootPassword: Root123$
charset: UTF8
projectId: 0
cpu: 1
memory: 2
storage: 10
tags:
CreateBy: Terraform
Create a postgresql instance with delete protection
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-3";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create vpc subnet
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: availabilityZone,
vpcId: vpc.vpcId,
cidrBlock: "10.0.20.0/28",
isMulticast: false,
});
// create postgresql
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
dbMajorVersion: "10",
engineVersion: "10.23",
rootUser: "root123",
rootPassword: "Root123$",
charset: "UTF8",
projectId: 0,
cpu: 1,
memory: 2,
storage: 10,
deleteProtection: true,
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-3"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create vpc subnet
subnet = tencentcloud.Subnet("subnet",
availability_zone=availability_zone,
vpc_id=vpc.vpc_id,
cidr_block="10.0.20.0/28",
is_multicast=False)
# create postgresql
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
db_major_version="10",
engine_version="10.23",
root_user="root123",
root_password="Root123$",
charset="UTF8",
project_id=0,
cpu=1,
memory=2,
storage=10,
delete_protection=True,
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-3"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
// create vpc
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// create vpc subnet
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(availabilityZone),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.20.0/28"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
// create postgresql
_, err = tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
DbMajorVersion: pulumi.String("10"),
EngineVersion: pulumi.String("10.23"),
RootUser: pulumi.String("root123"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("UTF8"),
ProjectId: pulumi.Float64(0),
Cpu: pulumi.Float64(1),
Memory: pulumi.Float64(2),
Storage: pulumi.Float64(10),
DeleteProtection: pulumi.Bool(true),
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
// create vpc
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
// create vpc subnet
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = availabilityZone,
VpcId = vpc.VpcId,
CidrBlock = "10.0.20.0/28",
IsMulticast = false,
});
// create postgresql
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
DbMajorVersion = "10",
EngineVersion = "10.23",
RootUser = "root123",
RootPassword = "Root123$",
Charset = "UTF8",
ProjectId = 0,
Cpu = 1,
Memory = 2,
Storage = 10,
DeleteProtection = true,
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-3");
// create vpc
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// create vpc subnet
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(availabilityZone)
.vpcId(vpc.vpcId())
.cidrBlock("10.0.20.0/28")
.isMulticast(false)
.build());
// create postgresql
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.dbMajorVersion("10")
.engineVersion("10.23")
.rootUser("root123")
.rootPassword("Root123$")
.charset("UTF8")
.projectId(0)
.cpu(1)
.memory(2)
.storage(10)
.deleteProtection(true)
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-3
resources:
# create vpc
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
# create vpc subnet
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${availabilityZone}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.20.0/28
isMulticast: false
# create postgresql
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
dbMajorVersion: '10'
engineVersion: '10.23'
rootUser: root123
rootPassword: Root123$
charset: UTF8
projectId: 0
cpu: 1
memory: 2
storage: 10
deleteProtection: true
tags:
CreateBy: Terraform
Create a multi available zone postgresql instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-6";
const standbyAvailabilityZone = config.get("standbyAvailabilityZone") || "ap-guangzhou-7";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create vpc subnet
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: availabilityZone,
vpcId: vpc.vpcId,
cidrBlock: "10.0.20.0/28",
isMulticast: false,
});
// create postgresql
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
dbMajorVersion: "10",
rootUser: "root123",
rootPassword: "Root123$",
charset: "UTF8",
projectId: 0,
memory: 2,
cpu: 1,
storage: 10,
dbNodeSets: [
{
role: "Primary",
zone: availabilityZone,
},
{
zone: standbyAvailabilityZone,
},
],
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-6"
standby_availability_zone = config.get("standbyAvailabilityZone")
if standby_availability_zone is None:
standby_availability_zone = "ap-guangzhou-7"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create vpc subnet
subnet = tencentcloud.Subnet("subnet",
availability_zone=availability_zone,
vpc_id=vpc.vpc_id,
cidr_block="10.0.20.0/28",
is_multicast=False)
# create postgresql
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
db_major_version="10",
root_user="root123",
root_password="Root123$",
charset="UTF8",
project_id=0,
memory=2,
cpu=1,
storage=10,
db_node_sets=[
{
"role": "Primary",
"zone": availability_zone,
},
{
"zone": standby_availability_zone,
},
],
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-6"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
standbyAvailabilityZone := "ap-guangzhou-7"
if param := cfg.Get("standbyAvailabilityZone"); param != "" {
standbyAvailabilityZone = param
}
// create vpc
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// create vpc subnet
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(availabilityZone),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.20.0/28"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
// create postgresql
_, err = tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
DbMajorVersion: pulumi.String("10"),
RootUser: pulumi.String("root123"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("UTF8"),
ProjectId: pulumi.Float64(0),
Memory: pulumi.Float64(2),
Cpu: pulumi.Float64(1),
Storage: pulumi.Float64(10),
DbNodeSets: tencentcloud.PostgresqlInstanceDbNodeSetArray{
&tencentcloud.PostgresqlInstanceDbNodeSetArgs{
Role: pulumi.String("Primary"),
Zone: pulumi.String(availabilityZone),
},
&tencentcloud.PostgresqlInstanceDbNodeSetArgs{
Zone: pulumi.String(standbyAvailabilityZone),
},
},
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-6";
var standbyAvailabilityZone = config.Get("standbyAvailabilityZone") ?? "ap-guangzhou-7";
// create vpc
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
// create vpc subnet
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = availabilityZone,
VpcId = vpc.VpcId,
CidrBlock = "10.0.20.0/28",
IsMulticast = false,
});
// create postgresql
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
DbMajorVersion = "10",
RootUser = "root123",
RootPassword = "Root123$",
Charset = "UTF8",
ProjectId = 0,
Memory = 2,
Cpu = 1,
Storage = 10,
DbNodeSets = new[]
{
new Tencentcloud.Inputs.PostgresqlInstanceDbNodeSetArgs
{
Role = "Primary",
Zone = availabilityZone,
},
new Tencentcloud.Inputs.PostgresqlInstanceDbNodeSetArgs
{
Zone = standbyAvailabilityZone,
},
},
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.inputs.PostgresqlInstanceDbNodeSetArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-6");
final var standbyAvailabilityZone = config.get("standbyAvailabilityZone").orElse("ap-guangzhou-7");
// create vpc
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// create vpc subnet
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(availabilityZone)
.vpcId(vpc.vpcId())
.cidrBlock("10.0.20.0/28")
.isMulticast(false)
.build());
// create postgresql
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.dbMajorVersion("10")
.rootUser("root123")
.rootPassword("Root123$")
.charset("UTF8")
.projectId(0)
.memory(2)
.cpu(1)
.storage(10)
.dbNodeSets(
PostgresqlInstanceDbNodeSetArgs.builder()
.role("Primary")
.zone(availabilityZone)
.build(),
PostgresqlInstanceDbNodeSetArgs.builder()
.zone(standbyAvailabilityZone)
.build())
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-6
standbyAvailabilityZone:
type: string
default: ap-guangzhou-7
resources:
# create vpc
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
# create vpc subnet
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${availabilityZone}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.20.0/28
isMulticast: false
# create postgresql
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
dbMajorVersion: '10'
rootUser: root123
rootPassword: Root123$
charset: UTF8
projectId: 0
memory: 2
cpu: 1
storage: 10
dbNodeSets:
- role: Primary
zone: ${availabilityZone}
- zone: ${standbyAvailabilityZone}
tags:
CreateBy: Terraform
Create a multi available zone postgresql instance of CDC
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-4";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create vpc subnet
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: availabilityZone,
vpcId: vpc.vpcId,
cidrBlock: "10.0.20.0/28",
isMulticast: false,
});
// create postgresql
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
dbMajorVersion: "10",
rootUser: "root123",
rootPassword: "Root123$",
charset: "UTF8",
projectId: 0,
memory: 2,
cpu: 1,
storage: 10,
dbNodeSets: [
{
role: "Primary",
zone: availabilityZone,
dedicatedClusterId: "cluster-262n63e8",
},
{
zone: availabilityZone,
dedicatedClusterId: "cluster-262n63e8",
},
],
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-4"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create vpc subnet
subnet = tencentcloud.Subnet("subnet",
availability_zone=availability_zone,
vpc_id=vpc.vpc_id,
cidr_block="10.0.20.0/28",
is_multicast=False)
# create postgresql
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
db_major_version="10",
root_user="root123",
root_password="Root123$",
charset="UTF8",
project_id=0,
memory=2,
cpu=1,
storage=10,
db_node_sets=[
{
"role": "Primary",
"zone": availability_zone,
"dedicated_cluster_id": "cluster-262n63e8",
},
{
"zone": availability_zone,
"dedicated_cluster_id": "cluster-262n63e8",
},
],
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-4"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
// create vpc
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// create vpc subnet
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(availabilityZone),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.20.0/28"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
// create postgresql
_, err = tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
DbMajorVersion: pulumi.String("10"),
RootUser: pulumi.String("root123"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("UTF8"),
ProjectId: pulumi.Float64(0),
Memory: pulumi.Float64(2),
Cpu: pulumi.Float64(1),
Storage: pulumi.Float64(10),
DbNodeSets: tencentcloud.PostgresqlInstanceDbNodeSetArray{
&tencentcloud.PostgresqlInstanceDbNodeSetArgs{
Role: pulumi.String("Primary"),
Zone: pulumi.String(availabilityZone),
DedicatedClusterId: pulumi.String("cluster-262n63e8"),
},
&tencentcloud.PostgresqlInstanceDbNodeSetArgs{
Zone: pulumi.String(availabilityZone),
DedicatedClusterId: pulumi.String("cluster-262n63e8"),
},
},
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-4";
// create vpc
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
// create vpc subnet
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = availabilityZone,
VpcId = vpc.VpcId,
CidrBlock = "10.0.20.0/28",
IsMulticast = false,
});
// create postgresql
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
DbMajorVersion = "10",
RootUser = "root123",
RootPassword = "Root123$",
Charset = "UTF8",
ProjectId = 0,
Memory = 2,
Cpu = 1,
Storage = 10,
DbNodeSets = new[]
{
new Tencentcloud.Inputs.PostgresqlInstanceDbNodeSetArgs
{
Role = "Primary",
Zone = availabilityZone,
DedicatedClusterId = "cluster-262n63e8",
},
new Tencentcloud.Inputs.PostgresqlInstanceDbNodeSetArgs
{
Zone = availabilityZone,
DedicatedClusterId = "cluster-262n63e8",
},
},
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.inputs.PostgresqlInstanceDbNodeSetArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-4");
// create vpc
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// create vpc subnet
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(availabilityZone)
.vpcId(vpc.vpcId())
.cidrBlock("10.0.20.0/28")
.isMulticast(false)
.build());
// create postgresql
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.dbMajorVersion("10")
.rootUser("root123")
.rootPassword("Root123$")
.charset("UTF8")
.projectId(0)
.memory(2)
.cpu(1)
.storage(10)
.dbNodeSets(
PostgresqlInstanceDbNodeSetArgs.builder()
.role("Primary")
.zone(availabilityZone)
.dedicatedClusterId("cluster-262n63e8")
.build(),
PostgresqlInstanceDbNodeSetArgs.builder()
.zone(availabilityZone)
.dedicatedClusterId("cluster-262n63e8")
.build())
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-4
resources:
# create vpc
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
# create vpc subnet
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${availabilityZone}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.20.0/28
isMulticast: false
# create postgresql
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
dbMajorVersion: '10'
rootUser: root123
rootPassword: Root123$
charset: UTF8
projectId: 0
memory: 2
cpu: 1
storage: 10
dbNodeSets:
- role: Primary
zone: ${availabilityZone}
dedicatedClusterId: cluster-262n63e8
- zone: ${availabilityZone}
dedicatedClusterId: cluster-262n63e8
tags:
CreateBy: Terraform
Create pgsql with kms key
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-6";
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: "vpc-86v957zb",
subnetId: "subnet-enm92y0m",
dbMajorVersion: "11",
engineVersion: "11.12",
dbKernelVersion: "v11.12_r1.3",
needSupportTde: 1,
kmsKeyId: "788c606a-c7b7-11ec-82d1-5254001e5c4e",
kmsRegion: "ap-guangzhou",
rootPassword: "Root123$",
charset: "LATIN1",
projectId: 0,
memory: 4,
storage: 100,
backupPlan: {
minBackupStartTime: "00:10:11",
maxBackupStartTime: "01:10:11",
baseBackupRetentionPeriod: 7,
backupPeriods: [
"tuesday",
"wednesday",
],
},
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-6"
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id="vpc-86v957zb",
subnet_id="subnet-enm92y0m",
db_major_version="11",
engine_version="11.12",
db_kernel_version="v11.12_r1.3",
need_support_tde=1,
kms_key_id="788c606a-c7b7-11ec-82d1-5254001e5c4e",
kms_region="ap-guangzhou",
root_password="Root123$",
charset="LATIN1",
project_id=0,
memory=4,
storage=100,
backup_plan={
"min_backup_start_time": "00:10:11",
"max_backup_start_time": "01:10:11",
"base_backup_retention_period": 7,
"backup_periods": [
"tuesday",
"wednesday",
],
},
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-6"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
_, err := tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: pulumi.String("vpc-86v957zb"),
SubnetId: pulumi.String("subnet-enm92y0m"),
DbMajorVersion: pulumi.String("11"),
EngineVersion: pulumi.String("11.12"),
DbKernelVersion: pulumi.String("v11.12_r1.3"),
NeedSupportTde: pulumi.Float64(1),
KmsKeyId: pulumi.String("788c606a-c7b7-11ec-82d1-5254001e5c4e"),
KmsRegion: pulumi.String("ap-guangzhou"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("LATIN1"),
ProjectId: pulumi.Float64(0),
Memory: pulumi.Float64(4),
Storage: pulumi.Float64(100),
BackupPlan: &tencentcloud.PostgresqlInstanceBackupPlanArgs{
MinBackupStartTime: pulumi.String("00:10:11"),
MaxBackupStartTime: pulumi.String("01:10:11"),
BaseBackupRetentionPeriod: pulumi.Float64(7),
BackupPeriods: pulumi.StringArray{
pulumi.String("tuesday"),
pulumi.String("wednesday"),
},
},
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-6";
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = "vpc-86v957zb",
SubnetId = "subnet-enm92y0m",
DbMajorVersion = "11",
EngineVersion = "11.12",
DbKernelVersion = "v11.12_r1.3",
NeedSupportTde = 1,
KmsKeyId = "788c606a-c7b7-11ec-82d1-5254001e5c4e",
KmsRegion = "ap-guangzhou",
RootPassword = "Root123$",
Charset = "LATIN1",
ProjectId = 0,
Memory = 4,
Storage = 100,
BackupPlan = new Tencentcloud.Inputs.PostgresqlInstanceBackupPlanArgs
{
MinBackupStartTime = "00:10:11",
MaxBackupStartTime = "01:10:11",
BaseBackupRetentionPeriod = 7,
BackupPeriods = new[]
{
"tuesday",
"wednesday",
},
},
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.inputs.PostgresqlInstanceBackupPlanArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-6");
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId("vpc-86v957zb")
.subnetId("subnet-enm92y0m")
.dbMajorVersion("11")
.engineVersion("11.12")
.dbKernelVersion("v11.12_r1.3")
.needSupportTde(1)
.kmsKeyId("788c606a-c7b7-11ec-82d1-5254001e5c4e")
.kmsRegion("ap-guangzhou")
.rootPassword("Root123$")
.charset("LATIN1")
.projectId(0)
.memory(4)
.storage(100)
.backupPlan(PostgresqlInstanceBackupPlanArgs.builder()
.minBackupStartTime("00:10:11")
.maxBackupStartTime("01:10:11")
.baseBackupRetentionPeriod(7)
.backupPeriods(
"tuesday",
"wednesday")
.build())
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-6
resources:
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: vpc-86v957zb
subnetId: subnet-enm92y0m
dbMajorVersion: '11'
engineVersion: '11.12'
dbKernelVersion: v11.12_r1.3
needSupportTde: 1
kmsKeyId: 788c606a-c7b7-11ec-82d1-5254001e5c4e
kmsRegion: ap-guangzhou
rootPassword: Root123$
charset: LATIN1
projectId: 0
memory: 4
storage: 100
backupPlan:
minBackupStartTime: 00:10:11
maxBackupStartTime: 01:10:11
baseBackupRetentionPeriod: 7
backupPeriods:
- tuesday
- wednesday
tags:
CreateBy: Terraform
Upgrade kernel version
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-6";
const example = new tencentcloud.PostgresqlInstance("example", {
availabilityZone: availabilityZone,
chargeType: "POSTPAID_BY_HOUR",
vpcId: "vpc-86v957zb",
subnetId: "subnet-enm92y0m",
engineVersion: "13.3",
dbKernelVersion: "v13.3_r1.4",
dbMajorVersion: "13",
rootPassword: "Root123$",
charset: "LATIN1",
projectId: 0,
publicAccessSwitch: false,
securityGroups: ["sg-cm7fbbf3"],
memory: 4,
storage: 250,
backupPlan: {
minBackupStartTime: "01:10:11",
maxBackupStartTime: "02:10:11",
baseBackupRetentionPeriod: 5,
backupPeriods: [
"monday",
"thursday",
"sunday",
],
},
tags: {
CreateBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-6"
example = tencentcloud.PostgresqlInstance("example",
availability_zone=availability_zone,
charge_type="POSTPAID_BY_HOUR",
vpc_id="vpc-86v957zb",
subnet_id="subnet-enm92y0m",
engine_version="13.3",
db_kernel_version="v13.3_r1.4",
db_major_version="13",
root_password="Root123$",
charset="LATIN1",
project_id=0,
public_access_switch=False,
security_groups=["sg-cm7fbbf3"],
memory=4,
storage=250,
backup_plan={
"min_backup_start_time": "01:10:11",
"max_backup_start_time": "02:10:11",
"base_backup_retention_period": 5,
"backup_periods": [
"monday",
"thursday",
"sunday",
],
},
tags={
"CreateBy": "Terraform",
})
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, "")
availabilityZone := "ap-guangzhou-6"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
_, err := tencentcloud.NewPostgresqlInstance(ctx, "example", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(availabilityZone),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
VpcId: pulumi.String("vpc-86v957zb"),
SubnetId: pulumi.String("subnet-enm92y0m"),
EngineVersion: pulumi.String("13.3"),
DbKernelVersion: pulumi.String("v13.3_r1.4"),
DbMajorVersion: pulumi.String("13"),
RootPassword: pulumi.String("Root123$"),
Charset: pulumi.String("LATIN1"),
ProjectId: pulumi.Float64(0),
PublicAccessSwitch: pulumi.Bool(false),
SecurityGroups: pulumi.StringArray{
pulumi.String("sg-cm7fbbf3"),
},
Memory: pulumi.Float64(4),
Storage: pulumi.Float64(250),
BackupPlan: &tencentcloud.PostgresqlInstanceBackupPlanArgs{
MinBackupStartTime: pulumi.String("01:10:11"),
MaxBackupStartTime: pulumi.String("02:10:11"),
BaseBackupRetentionPeriod: pulumi.Float64(5),
BackupPeriods: pulumi.StringArray{
pulumi.String("monday"),
pulumi.String("thursday"),
pulumi.String("sunday"),
},
},
Tags: pulumi.StringMap{
"CreateBy": pulumi.String("Terraform"),
},
})
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 availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-6";
var example = new Tencentcloud.PostgresqlInstance("example", new()
{
AvailabilityZone = availabilityZone,
ChargeType = "POSTPAID_BY_HOUR",
VpcId = "vpc-86v957zb",
SubnetId = "subnet-enm92y0m",
EngineVersion = "13.3",
DbKernelVersion = "v13.3_r1.4",
DbMajorVersion = "13",
RootPassword = "Root123$",
Charset = "LATIN1",
ProjectId = 0,
PublicAccessSwitch = false,
SecurityGroups = new[]
{
"sg-cm7fbbf3",
},
Memory = 4,
Storage = 250,
BackupPlan = new Tencentcloud.Inputs.PostgresqlInstanceBackupPlanArgs
{
MinBackupStartTime = "01:10:11",
MaxBackupStartTime = "02:10:11",
BaseBackupRetentionPeriod = 5,
BackupPeriods = new[]
{
"monday",
"thursday",
"sunday",
},
},
Tags =
{
{ "CreateBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.inputs.PostgresqlInstanceBackupPlanArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-6");
var example = new PostgresqlInstance("example", PostgresqlInstanceArgs.builder()
.availabilityZone(availabilityZone)
.chargeType("POSTPAID_BY_HOUR")
.vpcId("vpc-86v957zb")
.subnetId("subnet-enm92y0m")
.engineVersion("13.3")
.dbKernelVersion("v13.3_r1.4")
.dbMajorVersion("13")
.rootPassword("Root123$")
.charset("LATIN1")
.projectId(0)
.publicAccessSwitch(false)
.securityGroups("sg-cm7fbbf3")
.memory(4)
.storage(250)
.backupPlan(PostgresqlInstanceBackupPlanArgs.builder()
.minBackupStartTime("01:10:11")
.maxBackupStartTime("02:10:11")
.baseBackupRetentionPeriod(5)
.backupPeriods(
"monday",
"thursday",
"sunday")
.build())
.tags(Map.of("CreateBy", "Terraform"))
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-6
resources:
example:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${availabilityZone}
chargeType: POSTPAID_BY_HOUR
vpcId: vpc-86v957zb
subnetId: subnet-enm92y0m
engineVersion: '13.3'
dbKernelVersion: v13.3_r1.4
# eg:from v13.3_r1.1 to v13.3_r1.4
dbMajorVersion: '13'
rootPassword: Root123$
charset: LATIN1
projectId: 0
publicAccessSwitch: false
securityGroups:
- sg-cm7fbbf3
memory: 4
storage: 250
backupPlan:
minBackupStartTime: 01:10:11
maxBackupStartTime: 02:10:11
baseBackupRetentionPeriod: 5
backupPeriods:
- monday
- thursday
- sunday
tags:
CreateBy: Terraform
Create PostgresqlInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostgresqlInstance(name: string, args: PostgresqlInstanceArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlInstance(resource_name: str,
args: PostgresqlInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostgresqlInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
memory: Optional[float] = None,
vpc_id: Optional[str] = None,
availability_zone: Optional[str] = None,
subnet_id: Optional[str] = None,
storage: Optional[float] = None,
root_password: Optional[str] = None,
max_standby_archive_delay: Optional[float] = None,
name: Optional[str] = None,
db_major_version: Optional[str] = None,
db_major_vesion: Optional[str] = None,
db_node_sets: Optional[Sequence[PostgresqlInstanceDbNodeSetArgs]] = None,
delete_protection: Optional[bool] = None,
engine_version: Optional[str] = None,
kms_cluster_id: Optional[str] = None,
kms_key_id: Optional[str] = None,
kms_region: Optional[str] = None,
auto_renew_flag: Optional[float] = None,
max_standby_streaming_delay: Optional[float] = None,
cpu: Optional[float] = None,
db_kernel_version: Optional[str] = None,
need_support_tde: Optional[float] = None,
period: Optional[float] = None,
postgresql_instance_id: Optional[str] = None,
project_id: Optional[float] = None,
public_access_switch: Optional[bool] = None,
charset: Optional[str] = None,
root_user: Optional[str] = None,
security_groups: Optional[Sequence[str]] = None,
charge_type: Optional[str] = None,
backup_plan: Optional[PostgresqlInstanceBackupPlanArgs] = None,
tags: Optional[Mapping[str, str]] = None,
voucher_ids: Optional[Sequence[str]] = None,
auto_voucher: Optional[float] = None,
wait_switch: Optional[float] = None)
func NewPostgresqlInstance(ctx *Context, name string, args PostgresqlInstanceArgs, opts ...ResourceOption) (*PostgresqlInstance, error)
public PostgresqlInstance(string name, PostgresqlInstanceArgs args, CustomResourceOptions? opts = null)
public PostgresqlInstance(String name, PostgresqlInstanceArgs args)
public PostgresqlInstance(String name, PostgresqlInstanceArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlInstance
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 PostgresqlInstanceArgs
- 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 PostgresqlInstanceArgs
- 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 PostgresqlInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresqlInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresqlInstanceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PostgresqlInstance 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 PostgresqlInstance resource accepts the following input properties:
- Availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - Memory double
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- Storage double
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Subnet
Id string - ID of subnet.
- Vpc
Id string - ID of VPC.
- Auto
Renew doubleFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - Auto
Voucher double - Whether to use voucher,
1
for enabled. - Backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- Charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - Charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - Cpu double
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- Db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- Db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- Db
Node List<PostgresqlSets Instance Db Node Set> - Specify instance node info for disaster migration.
- Delete
Protection bool - Whether to enable instance deletion protection. Default: false.
- Engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - Kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- Kms
Key stringId - KeyId of the custom key.
- Kms
Region string - Region of the custom key.
- Max
Standby doubleArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- Max
Standby doubleStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- Name string
- Name of the postgresql instance.
- Need
Support doubleTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- Period double
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - Postgresql
Instance stringId - ID of the resource.
- Project
Id double - Project id, default value is
0
. - Public
Access boolSwitch - Indicates whether to enable the access to an instance from public network or not.
- Root
User string - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- Dictionary<string, string>
- The available tags within this postgresql.
- Voucher
Ids List<string> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - Wait
Switch double - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- Availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - Memory float64
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- Storage float64
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Subnet
Id string - ID of subnet.
- Vpc
Id string - ID of VPC.
- Auto
Renew float64Flag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - Auto
Voucher float64 - Whether to use voucher,
1
for enabled. - Backup
Plan PostgresqlInstance Backup Plan Args - Specify DB backup plan.
- Charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - Charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - Cpu float64
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- Db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- Db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- Db
Node []PostgresqlSets Instance Db Node Set Args - Specify instance node info for disaster migration.
- Delete
Protection bool - Whether to enable instance deletion protection. Default: false.
- Engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - Kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- Kms
Key stringId - KeyId of the custom key.
- Kms
Region string - Region of the custom key.
- Max
Standby float64Archive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- Max
Standby float64Streaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- Name string
- Name of the postgresql instance.
- Need
Support float64Tde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- Period float64
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - Postgresql
Instance stringId - ID of the resource.
- Project
Id float64 - Project id, default value is
0
. - Public
Access boolSwitch - Indicates whether to enable the access to an instance from public network or not.
- Root
User string - Instance root account name. This parameter is optional, Default value is
root
. - Security
Groups []string - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- map[string]string
- The available tags within this postgresql.
- Voucher
Ids []string - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - Wait
Switch float64 - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- availability
Zone String - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - memory Double
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - root
Password String - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- storage Double
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id String - ID of subnet.
- vpc
Id String - ID of VPC.
- auto
Renew DoubleFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher Double - Whether to use voucher,
1
for enabled. - backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- charge
Type String - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset String
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu Double
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - db
Kernel StringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major StringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major StringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node List<PostgresqlSets Instance Db Node Set> - Specify instance node info for disaster migration.
- delete
Protection Boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version String - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster StringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key StringId - KeyId of the custom key.
- kms
Region String - Region of the custom key.
- max
Standby DoubleArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby DoubleStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- name String
- Name of the postgresql instance.
- need
Support DoubleTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period Double
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance StringId - ID of the resource.
- project
Id Double - Project id, default value is
0
. - public
Access BooleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
User String - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- Map<String,String>
- The available tags within this postgresql.
- voucher
Ids List<String> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - wait
Switch Double - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - memory number
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- storage number
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id string - ID of subnet.
- vpc
Id string - ID of VPC.
- auto
Renew numberFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher number - Whether to use voucher,
1
for enabled. - backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu number
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node PostgresqlSets Instance Db Node Set[] - Specify instance node info for disaster migration.
- delete
Protection boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key stringId - KeyId of the custom key.
- kms
Region string - Region of the custom key.
- max
Standby numberArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby numberStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- name string
- Name of the postgresql instance.
- need
Support numberTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period number
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance stringId - ID of the resource.
- project
Id number - Project id, default value is
0
. - public
Access booleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
User string - Instance root account name. This parameter is optional, Default value is
root
. - security
Groups string[] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- {[key: string]: string}
- The available tags within this postgresql.
- voucher
Ids string[] - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - wait
Switch number - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- availability_
zone str - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - memory float
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - root_
password str - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- storage float
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet_
id str - ID of subnet.
- vpc_
id str - ID of VPC.
- auto_
renew_ floatflag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto_
voucher float - Whether to use voucher,
1
for enabled. - backup_
plan PostgresqlInstance Backup Plan Args - Specify DB backup plan.
- charge_
type str - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset str
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu float
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - db_
kernel_ strversion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db_
major_ strversion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db_
major_ strvesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db_
node_ Sequence[Postgresqlsets Instance Db Node Set Args] - Specify instance node info for disaster migration.
- delete_
protection bool - Whether to enable instance deletion protection. Default: false.
- engine_
version str - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms_
cluster_ strid - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms_
key_ strid - KeyId of the custom key.
- kms_
region str - Region of the custom key.
- max_
standby_ floatarchive_ delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max_
standby_ floatstreaming_ delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- name str
- Name of the postgresql instance.
- need_
support_ floattde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period float
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql_
instance_ strid - ID of the resource.
- project_
id float - Project id, default value is
0
. - public_
access_ boolswitch - Indicates whether to enable the access to an instance from public network or not.
- root_
user str - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- Mapping[str, str]
- The available tags within this postgresql.
- voucher_
ids Sequence[str] - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - wait_
switch float - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- availability
Zone String - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - memory Number
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - root
Password String - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- storage Number
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id String - ID of subnet.
- vpc
Id String - ID of VPC.
- auto
Renew NumberFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher Number - Whether to use voucher,
1
for enabled. - backup
Plan Property Map - Specify DB backup plan.
- charge
Type String - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset String
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu Number
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - db
Kernel StringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major StringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major StringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node List<Property Map>Sets - Specify instance node info for disaster migration.
- delete
Protection Boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version String - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster StringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key StringId - KeyId of the custom key.
- kms
Region String - Region of the custom key.
- max
Standby NumberArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby NumberStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- name String
- Name of the postgresql instance.
- need
Support NumberTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period Number
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance StringId - ID of the resource.
- project
Id Number - Project id, default value is
0
. - public
Access BooleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
User String - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- Map<String>
- The available tags within this postgresql.
- voucher
Ids List<String> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - wait
Switch Number - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresqlInstance resource produces the following output properties:
- Create
Time string - Create time of the postgresql instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Access stringIp - IP for private access.
- Private
Access doublePort - Port for private access.
- Public
Access stringHost - Host for public access.
- Public
Access doublePort - Port for public access.
- Uid double
- Uid of the postgresql instance.
- Create
Time string - Create time of the postgresql instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Access stringIp - IP for private access.
- Private
Access float64Port - Port for private access.
- Public
Access stringHost - Host for public access.
- Public
Access float64Port - Port for public access.
- Uid float64
- Uid of the postgresql instance.
- create
Time String - Create time of the postgresql instance.
- id String
- The provider-assigned unique ID for this managed resource.
- private
Access StringIp - IP for private access.
- private
Access DoublePort - Port for private access.
- public
Access StringHost - Host for public access.
- public
Access DoublePort - Port for public access.
- uid Double
- Uid of the postgresql instance.
- create
Time string - Create time of the postgresql instance.
- id string
- The provider-assigned unique ID for this managed resource.
- private
Access stringIp - IP for private access.
- private
Access numberPort - Port for private access.
- public
Access stringHost - Host for public access.
- public
Access numberPort - Port for public access.
- uid number
- Uid of the postgresql instance.
- create_
time str - Create time of the postgresql instance.
- id str
- The provider-assigned unique ID for this managed resource.
- private_
access_ strip - IP for private access.
- private_
access_ floatport - Port for private access.
- public_
access_ strhost - Host for public access.
- public_
access_ floatport - Port for public access.
- uid float
- Uid of the postgresql instance.
- create
Time String - Create time of the postgresql instance.
- id String
- The provider-assigned unique ID for this managed resource.
- private
Access StringIp - IP for private access.
- private
Access NumberPort - Port for private access.
- public
Access StringHost - Host for public access.
- public
Access NumberPort - Port for public access.
- uid Number
- Uid of the postgresql instance.
Look up Existing PostgresqlInstance Resource
Get an existing PostgresqlInstance 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?: PostgresqlInstanceState, opts?: CustomResourceOptions): PostgresqlInstance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_renew_flag: Optional[float] = None,
auto_voucher: Optional[float] = None,
availability_zone: Optional[str] = None,
backup_plan: Optional[PostgresqlInstanceBackupPlanArgs] = None,
charge_type: Optional[str] = None,
charset: Optional[str] = None,
cpu: Optional[float] = None,
create_time: Optional[str] = None,
db_kernel_version: Optional[str] = None,
db_major_version: Optional[str] = None,
db_major_vesion: Optional[str] = None,
db_node_sets: Optional[Sequence[PostgresqlInstanceDbNodeSetArgs]] = None,
delete_protection: Optional[bool] = None,
engine_version: Optional[str] = None,
kms_cluster_id: Optional[str] = None,
kms_key_id: Optional[str] = None,
kms_region: Optional[str] = None,
max_standby_archive_delay: Optional[float] = None,
max_standby_streaming_delay: Optional[float] = None,
memory: Optional[float] = None,
name: Optional[str] = None,
need_support_tde: Optional[float] = None,
period: Optional[float] = None,
postgresql_instance_id: Optional[str] = None,
private_access_ip: Optional[str] = None,
private_access_port: Optional[float] = None,
project_id: Optional[float] = None,
public_access_host: Optional[str] = None,
public_access_port: Optional[float] = None,
public_access_switch: Optional[bool] = None,
root_password: Optional[str] = None,
root_user: Optional[str] = None,
security_groups: Optional[Sequence[str]] = None,
storage: Optional[float] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
uid: Optional[float] = None,
voucher_ids: Optional[Sequence[str]] = None,
vpc_id: Optional[str] = None,
wait_switch: Optional[float] = None) -> PostgresqlInstance
func GetPostgresqlInstance(ctx *Context, name string, id IDInput, state *PostgresqlInstanceState, opts ...ResourceOption) (*PostgresqlInstance, error)
public static PostgresqlInstance Get(string name, Input<string> id, PostgresqlInstanceState? state, CustomResourceOptions? opts = null)
public static PostgresqlInstance get(String name, Output<String> id, PostgresqlInstanceState state, CustomResourceOptions options)
resources: _: type: tencentcloud:PostgresqlInstance 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,
1
for enabled. NOTES: Only support prepaid instance. - Auto
Voucher double - Whether to use voucher,
1
for enabled. - Availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - Backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- Charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - Charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - Cpu double
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Create
Time string - Create time of the postgresql instance.
- Db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- Db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- Db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- Db
Node List<PostgresqlSets Instance Db Node Set> - Specify instance node info for disaster migration.
- Delete
Protection bool - Whether to enable instance deletion protection. Default: false.
- Engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - Kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- Kms
Key stringId - KeyId of the custom key.
- Kms
Region string - Region of the custom key.
- Max
Standby doubleArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- Max
Standby doubleStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- Memory double
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Name string
- Name of the postgresql instance.
- Need
Support doubleTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- Period double
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - Postgresql
Instance stringId - ID of the resource.
- Private
Access stringIp - IP for private access.
- Private
Access doublePort - Port for private access.
- Project
Id double - Project id, default value is
0
. - Public
Access stringHost - Host for public access.
- Public
Access doublePort - Port for public access.
- Public
Access boolSwitch - Indicates whether to enable the access to an instance from public network or not.
- Root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- Root
User string - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- Storage double
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Subnet
Id string - ID of subnet.
- Dictionary<string, string>
- The available tags within this postgresql.
- Uid double
- Uid of the postgresql instance.
- Voucher
Ids List<string> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - Vpc
Id string - ID of VPC.
- Wait
Switch double - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- Auto
Renew float64Flag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - Auto
Voucher float64 - Whether to use voucher,
1
for enabled. - Availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - Backup
Plan PostgresqlInstance Backup Plan Args - Specify DB backup plan.
- Charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - Charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - Cpu float64
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Create
Time string - Create time of the postgresql instance.
- Db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- Db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- Db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- Db
Node []PostgresqlSets Instance Db Node Set Args - Specify instance node info for disaster migration.
- Delete
Protection bool - Whether to enable instance deletion protection. Default: false.
- Engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - Kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- Kms
Key stringId - KeyId of the custom key.
- Kms
Region string - Region of the custom key.
- Max
Standby float64Archive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- Max
Standby float64Streaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- Memory float64
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Name string
- Name of the postgresql instance.
- Need
Support float64Tde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- Period float64
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - Postgresql
Instance stringId - ID of the resource.
- Private
Access stringIp - IP for private access.
- Private
Access float64Port - Port for private access.
- Project
Id float64 - Project id, default value is
0
. - Public
Access stringHost - Host for public access.
- Public
Access float64Port - Port for public access.
- Public
Access boolSwitch - Indicates whether to enable the access to an instance from public network or not.
- Root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- Root
User string - Instance root account name. This parameter is optional, Default value is
root
. - Security
Groups []string - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- Storage float64
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - Subnet
Id string - ID of subnet.
- map[string]string
- The available tags within this postgresql.
- Uid float64
- Uid of the postgresql instance.
- Voucher
Ids []string - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - Vpc
Id string - ID of VPC.
- Wait
Switch float64 - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- auto
Renew DoubleFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher Double - Whether to use voucher,
1
for enabled. - availability
Zone String - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- charge
Type String - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset String
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu Double
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - create
Time String - Create time of the postgresql instance.
- db
Kernel StringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major StringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major StringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node List<PostgresqlSets Instance Db Node Set> - Specify instance node info for disaster migration.
- delete
Protection Boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version String - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster StringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key StringId - KeyId of the custom key.
- kms
Region String - Region of the custom key.
- max
Standby DoubleArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby DoubleStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- memory Double
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - name String
- Name of the postgresql instance.
- need
Support DoubleTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period Double
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance StringId - ID of the resource.
- private
Access StringIp - IP for private access.
- private
Access DoublePort - Port for private access.
- project
Id Double - Project id, default value is
0
. - public
Access StringHost - Host for public access.
- public
Access DoublePort - Port for public access.
- public
Access BooleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
Password String - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- root
User String - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- storage Double
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id String - ID of subnet.
- Map<String,String>
- The available tags within this postgresql.
- uid Double
- Uid of the postgresql instance.
- voucher
Ids List<String> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - vpc
Id String - ID of VPC.
- wait
Switch Double - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- auto
Renew numberFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher number - Whether to use voucher,
1
for enabled. - availability
Zone string - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - backup
Plan PostgresqlInstance Backup Plan - Specify DB backup plan.
- charge
Type string - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset string
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu number
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - create
Time string - Create time of the postgresql instance.
- db
Kernel stringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major stringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major stringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node PostgresqlSets Instance Db Node Set[] - Specify instance node info for disaster migration.
- delete
Protection boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version string - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster stringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key stringId - KeyId of the custom key.
- kms
Region string - Region of the custom key.
- max
Standby numberArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby numberStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- memory number
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - name string
- Name of the postgresql instance.
- need
Support numberTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period number
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance stringId - ID of the resource.
- private
Access stringIp - IP for private access.
- private
Access numberPort - Port for private access.
- project
Id number - Project id, default value is
0
. - public
Access stringHost - Host for public access.
- public
Access numberPort - Port for public access.
- public
Access booleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
Password string - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- root
User string - Instance root account name. This parameter is optional, Default value is
root
. - security
Groups string[] - ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
- storage number
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id string - ID of subnet.
- {[key: string]: string}
- The available tags within this postgresql.
- uid number
- Uid of the postgresql instance.
- voucher
Ids string[] - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - vpc
Id string - ID of VPC.
- wait
Switch number - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- auto_
renew_ floatflag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto_
voucher float - Whether to use voucher,
1
for enabled. - availability_
zone str - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - backup_
plan PostgresqlInstance Backup Plan Args - Specify DB backup plan.
- charge_
type str - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset str
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu float
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - create_
time str - Create time of the postgresql instance.
- db_
kernel_ strversion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db_
major_ strversion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db_
major_ strvesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db_
node_ Sequence[Postgresqlsets Instance Db Node Set Args] - Specify instance node info for disaster migration.
- delete_
protection bool - Whether to enable instance deletion protection. Default: false.
- engine_
version str - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms_
cluster_ strid - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms_
key_ strid - KeyId of the custom key.
- kms_
region str - Region of the custom key.
- max_
standby_ floatarchive_ delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max_
standby_ floatstreaming_ delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- memory float
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - name str
- Name of the postgresql instance.
- need_
support_ floattde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period float
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql_
instance_ strid - ID of the resource.
- private_
access_ strip - IP for private access.
- private_
access_ floatport - Port for private access.
- project_
id float - Project id, default value is
0
. - public_
access_ strhost - Host for public access.
- public_
access_ floatport - Port for public access.
- public_
access_ boolswitch - Indicates whether to enable the access to an instance from public network or not.
- root_
password str - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- root_
user str - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- storage float
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet_
id str - ID of subnet.
- Mapping[str, str]
- The available tags within this postgresql.
- uid float
- Uid of the postgresql instance.
- voucher_
ids Sequence[str] - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - vpc_
id str - ID of VPC.
- wait_
switch float - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
- auto
Renew NumberFlag - Auto renew flag,
1
for enabled. NOTES: Only support prepaid instance. - auto
Voucher Number - Whether to use voucher,
1
for enabled. - availability
Zone String - Availability zone. NOTE: This field could not be modified, please use
db_node_set
instead of modification. The changes on this field will be suppressed when using thedb_node_set
. - backup
Plan Property Map - Specify DB backup plan.
- charge
Type String - Pay type of the postgresql instance. Values
POSTPAID_BY_HOUR
(Default),PREPAID
. It only support to update the type fromPOSTPAID_BY_HOUR
toPREPAID
. - charset String
- Charset of the root account. Valid values are
UTF8
,LATIN1
. - cpu Number
- Number of CPU cores. Allowed value must be equal
cpu
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - create
Time String - Create time of the postgresql instance.
- db
Kernel StringVersion - PostgreSQL kernel version number. If it is specified, an instance running kernel DBKernelVersion will be created. It supports updating the minor kernel version immediately.
- db
Major StringVersion - PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.
- db
Major StringVesion db_major_vesion
will be deprecated, usedb_major_version
instead. PostgreSQL major version number. Valid values: 10, 11, 12, 13, 14, 15, 16. If it is specified, an instance running the latest kernel of PostgreSQL DBMajorVersion will be created.- db
Node List<Property Map>Sets - Specify instance node info for disaster migration.
- delete
Protection Boolean - Whether to enable instance deletion protection. Default: false.
- engine
Version String - Version of the postgresql database engine. Valid values:
10.4
,10.17
,10.23
,11.8
,11.12
,11.22
,12.4
,12.7
,12.18
,13.3
,14.2
,14.11
,15.1
,16.0
. - kms
Cluster StringId - Specify the cluster served by KMS. If KMSClusterId is blank, use the KMS of the default cluster. If you choose to specify a KMS cluster, you need to pass in KMSClusterId.
- kms
Key StringId - KeyId of the custom key.
- kms
Region String - Region of the custom key.
- max
Standby NumberArchive Delay - max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). Units are milliseconds if not specified.
- max
Standby NumberStreaming Delay - max_standby_streaming_delay applies when WAL data is being received via streaming replication. Units are milliseconds if not specified.
- memory Number
- Memory size(in GB). Allowed value must be larger than
memory
that data sourcetencentcloud.getPostgresqlSpecinfos
provides. - name String
- Name of the postgresql instance.
- need
Support NumberTde - Whether to support data transparent encryption, 1: yes, 0: no (default).
- period Number
- Specify Prepaid period in month. Default
1
. Values:1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,24
,36
. This field is valid only when creating aPREPAID
type instance, or updating the charge type fromPOSTPAID_BY_HOUR
toPREPAID
. - postgresql
Instance StringId - ID of the resource.
- private
Access StringIp - IP for private access.
- private
Access NumberPort - Port for private access.
- project
Id Number - Project id, default value is
0
. - public
Access StringHost - Host for public access.
- public
Access NumberPort - Port for public access.
- public
Access BooleanSwitch - Indicates whether to enable the access to an instance from public network or not.
- root
Password String - Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored when you purchase read-only instances or disaster recovery instances.
- root
User String - Instance root account name. This parameter is optional, Default value is
root
. - 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.
- storage Number
- Volume size(in GB). Allowed value must be a multiple of 10. The storage must be set with the limit of
storage_min
andstorage_max
which data sourcetencentcloud.getPostgresqlSpecinfos
provides. - subnet
Id String - ID of subnet.
- Map<String>
- The available tags within this postgresql.
- uid Number
- Uid of the postgresql instance.
- voucher
Ids List<String> - Specify Voucher Ids if
auto_voucher
was1
, only support using 1 vouchers for now. - vpc
Id String - ID of VPC.
- wait
Switch Number - Switch time after instance configurations are modified.
0
: Switch immediately;2
: Switch during maintenance time window. Default:0
. Note: This only takes effect when updating thememory
,storage
,cpu
,db_node_set
,db_kernel_version
fields.
Supporting Types
PostgresqlInstanceBackupPlan, PostgresqlInstanceBackupPlanArgs
- Backup
Periods List<string> - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - Base
Backup doubleRetention Period - Specify days of the retention.
- Max
Backup stringStart Time - Specify latest backup start time, format
hh:mm:ss
. - Min
Backup stringStart Time - Specify earliest backup start time, format
hh:mm:ss
. - Monthly
Backup List<string>Periods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- Monthly
Backup doubleRetention Period - Specify days of the retention.
- Monthly
Plan stringId - Monthly plan id.
- Backup
Periods []string - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - Base
Backup float64Retention Period - Specify days of the retention.
- Max
Backup stringStart Time - Specify latest backup start time, format
hh:mm:ss
. - Min
Backup stringStart Time - Specify earliest backup start time, format
hh:mm:ss
. - Monthly
Backup []stringPeriods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- Monthly
Backup float64Retention Period - Specify days of the retention.
- Monthly
Plan stringId - Monthly plan id.
- backup
Periods List<String> - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - base
Backup DoubleRetention Period - Specify days of the retention.
- max
Backup StringStart Time - Specify latest backup start time, format
hh:mm:ss
. - min
Backup StringStart Time - Specify earliest backup start time, format
hh:mm:ss
. - monthly
Backup List<String>Periods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- monthly
Backup DoubleRetention Period - Specify days of the retention.
- monthly
Plan StringId - Monthly plan id.
- backup
Periods string[] - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - base
Backup numberRetention Period - Specify days of the retention.
- max
Backup stringStart Time - Specify latest backup start time, format
hh:mm:ss
. - min
Backup stringStart Time - Specify earliest backup start time, format
hh:mm:ss
. - monthly
Backup string[]Periods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- monthly
Backup numberRetention Period - Specify days of the retention.
- monthly
Plan stringId - Monthly plan id.
- backup_
periods Sequence[str] - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - base_
backup_ floatretention_ period - Specify days of the retention.
- max_
backup_ strstart_ time - Specify latest backup start time, format
hh:mm:ss
. - min_
backup_ strstart_ time - Specify earliest backup start time, format
hh:mm:ss
. - monthly_
backup_ Sequence[str]periods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- monthly_
backup_ floatretention_ period - Specify days of the retention.
- monthly_
plan_ strid - Monthly plan id.
- backup
Periods List<String> - List of backup period per week, available values:
monday
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
. NOTE: At least specify two days. - base
Backup NumberRetention Period - Specify days of the retention.
- max
Backup StringStart Time - Specify latest backup start time, format
hh:mm:ss
. - min
Backup StringStart Time - Specify earliest backup start time, format
hh:mm:ss
. - monthly
Backup List<String>Periods - If it is in monthly dimension, the format is numeric characters, such as ["1","2"].
- monthly
Backup NumberRetention Period - Specify days of the retention.
- monthly
Plan StringId - Monthly plan id.
PostgresqlInstanceDbNodeSet, PostgresqlInstanceDbNodeSetArgs
- Zone string
- Indicates the node available zone.
- Dedicated
Cluster stringId - Dedicated cluster ID.
- Role string
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
- Zone string
- Indicates the node available zone.
- Dedicated
Cluster stringId - Dedicated cluster ID.
- Role string
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
- zone String
- Indicates the node available zone.
- dedicated
Cluster StringId - Dedicated cluster ID.
- role String
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
- zone string
- Indicates the node available zone.
- dedicated
Cluster stringId - Dedicated cluster ID.
- role string
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
- zone str
- Indicates the node available zone.
- dedicated_
cluster_ strid - Dedicated cluster ID.
- role str
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
- zone String
- Indicates the node available zone.
- dedicated
Cluster StringId - Dedicated cluster ID.
- role String
- Indicates node type, available values:
Primary
,Standby
. Default:Standby
.
Import
postgresql instance can be imported using the id, e.g.
$ pulumi import tencentcloud:index/postgresqlInstance:PostgresqlInstance example postgres-cda1iex1
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
tencentcloud
Terraform Provider.