published on Friday, Jul 24, 2026 by tencentcloudstack
published on Friday, Jul 24, 2026 by tencentcloudstack
Provides a resource to create a PostgreSQL backup plan
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.PostgresqlBackupPlan("example", {
dbInstanceId: "postgres-ckwcgdf1",
planName: "tf-example",
backupPeriodType: "month",
backupPeriods: [
"1",
"2",
"15",
],
minBackupStartTime: "01:00:00",
maxBackupStartTime: "03:00:00",
baseBackupRetentionPeriod: 30,
logBackupRetentionPeriod: 7,
backupMethod: "physical",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.PostgresqlBackupPlan("example",
db_instance_id="postgres-ckwcgdf1",
plan_name="tf-example",
backup_period_type="month",
backup_periods=[
"1",
"2",
"15",
],
min_backup_start_time="01:00:00",
max_backup_start_time="03:00:00",
base_backup_retention_period=30,
log_backup_retention_period=7,
backup_method="physical")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewPostgresqlBackupPlan(ctx, "example", &tencentcloud.PostgresqlBackupPlanArgs{
DbInstanceId: pulumi.String("postgres-ckwcgdf1"),
PlanName: pulumi.String("tf-example"),
BackupPeriodType: pulumi.String("month"),
BackupPeriods: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("15"),
},
MinBackupStartTime: pulumi.String("01:00:00"),
MaxBackupStartTime: pulumi.String("03:00:00"),
BaseBackupRetentionPeriod: pulumi.Float64(30),
LogBackupRetentionPeriod: pulumi.Float64(7),
BackupMethod: pulumi.String("physical"),
})
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 example = new Tencentcloud.PostgresqlBackupPlan("example", new()
{
DbInstanceId = "postgres-ckwcgdf1",
PlanName = "tf-example",
BackupPeriodType = "month",
BackupPeriods = new[]
{
"1",
"2",
"15",
},
MinBackupStartTime = "01:00:00",
MaxBackupStartTime = "03:00:00",
BaseBackupRetentionPeriod = 30,
LogBackupRetentionPeriod = 7,
BackupMethod = "physical",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlBackupPlan;
import com.pulumi.tencentcloud.PostgresqlBackupPlanArgs;
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) {
var example = new PostgresqlBackupPlan("example", PostgresqlBackupPlanArgs.builder()
.dbInstanceId("postgres-ckwcgdf1")
.planName("tf-example")
.backupPeriodType("month")
.backupPeriods(
"1",
"2",
"15")
.minBackupStartTime("01:00:00")
.maxBackupStartTime("03:00:00")
.baseBackupRetentionPeriod(30.0)
.logBackupRetentionPeriod(7.0)
.backupMethod("physical")
.build());
}
}
resources:
example:
type: tencentcloud:PostgresqlBackupPlan
properties:
dbInstanceId: postgres-ckwcgdf1
planName: tf-example
backupPeriodType: month
backupPeriods:
- '1'
- '2'
- '15'
minBackupStartTime: 01:00:00
maxBackupStartTime: 03:00:00
baseBackupRetentionPeriod: 30
logBackupRetentionPeriod: 7
backupMethod: physical
Example coming soon!
Create PostgresqlBackupPlan Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostgresqlBackupPlan(name: string, args: PostgresqlBackupPlanArgs, opts?: CustomResourceOptions);@overload
def PostgresqlBackupPlan(resource_name: str,
args: PostgresqlBackupPlanArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostgresqlBackupPlan(resource_name: str,
opts: Optional[ResourceOptions] = None,
backup_period_type: Optional[str] = None,
backup_periods: Optional[Sequence[str]] = None,
db_instance_id: Optional[str] = None,
plan_name: Optional[str] = None,
backup_method: Optional[str] = None,
base_backup_retention_period: Optional[float] = None,
log_backup_retention_period: Optional[float] = None,
max_backup_start_time: Optional[str] = None,
min_backup_start_time: Optional[str] = None,
postgresql_backup_plan_id: Optional[str] = None)func NewPostgresqlBackupPlan(ctx *Context, name string, args PostgresqlBackupPlanArgs, opts ...ResourceOption) (*PostgresqlBackupPlan, error)public PostgresqlBackupPlan(string name, PostgresqlBackupPlanArgs args, CustomResourceOptions? opts = null)
public PostgresqlBackupPlan(String name, PostgresqlBackupPlanArgs args)
public PostgresqlBackupPlan(String name, PostgresqlBackupPlanArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlBackupPlan
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "tencentcloud_postgresql_backup_plan" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PostgresqlBackupPlanArgs
- 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 PostgresqlBackupPlanArgs
- 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 PostgresqlBackupPlanArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresqlBackupPlanArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresqlBackupPlanArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PostgresqlBackupPlan 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 PostgresqlBackupPlan resource accepts the following input properties:
- Backup
Period stringType - Backup period type, currently only supports month.
- Backup
Periods List<string> - Backup dates, such as backing up on the 2nd of each month.
- Db
Instance stringId - Instance ID.
- Plan
Name string - Backup plan name.
- Backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- Base
Backup doubleRetention Period - Data backup retention period in days. Value range: [0, 30000).
- Log
Backup doubleRetention Period - Log backup retention period in days. Value range: 7-1830.
- Max
Backup stringStart Time - The latest time to start a backup.
- Min
Backup stringStart Time - The earliest time to start a backup.
- Postgresql
Backup stringPlan Id - ID of the resource.
- Backup
Period stringType - Backup period type, currently only supports month.
- Backup
Periods []string - Backup dates, such as backing up on the 2nd of each month.
- Db
Instance stringId - Instance ID.
- Plan
Name string - Backup plan name.
- Backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- Base
Backup float64Retention Period - Data backup retention period in days. Value range: [0, 30000).
- Log
Backup float64Retention Period - Log backup retention period in days. Value range: 7-1830.
- Max
Backup stringStart Time - The latest time to start a backup.
- Min
Backup stringStart Time - The earliest time to start a backup.
- Postgresql
Backup stringPlan Id - ID of the resource.
- backup_
period_ stringtype - Backup period type, currently only supports month.
- backup_
periods list(string) - Backup dates, such as backing up on the 2nd of each month.
- db_
instance_ stringid - Instance ID.
- plan_
name string - Backup plan name.
- backup_
method string - Backup method. Enumerated values: physical, logical, snapshot.
- base_
backup_ numberretention_ period - Data backup retention period in days. Value range: [0, 30000).
- log_
backup_ numberretention_ period - Log backup retention period in days. Value range: 7-1830.
- max_
backup_ stringstart_ time - The latest time to start a backup.
- min_
backup_ stringstart_ time - The earliest time to start a backup.
- postgresql_
backup_ stringplan_ id - ID of the resource.
- backup
Period StringType - Backup period type, currently only supports month.
- backup
Periods List<String> - Backup dates, such as backing up on the 2nd of each month.
- db
Instance StringId - Instance ID.
- plan
Name String - Backup plan name.
- backup
Method String - Backup method. Enumerated values: physical, logical, snapshot.
- base
Backup DoubleRetention Period - Data backup retention period in days. Value range: [0, 30000).
- log
Backup DoubleRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup StringStart Time - The latest time to start a backup.
- min
Backup StringStart Time - The earliest time to start a backup.
- postgresql
Backup StringPlan Id - ID of the resource.
- backup
Period stringType - Backup period type, currently only supports month.
- backup
Periods string[] - Backup dates, such as backing up on the 2nd of each month.
- db
Instance stringId - Instance ID.
- plan
Name string - Backup plan name.
- backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- base
Backup numberRetention Period - Data backup retention period in days. Value range: [0, 30000).
- log
Backup numberRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup stringStart Time - The latest time to start a backup.
- min
Backup stringStart Time - The earliest time to start a backup.
- postgresql
Backup stringPlan Id - ID of the resource.
- backup_
period_ strtype - Backup period type, currently only supports month.
- backup_
periods Sequence[str] - Backup dates, such as backing up on the 2nd of each month.
- db_
instance_ strid - Instance ID.
- plan_
name str - Backup plan name.
- backup_
method str - Backup method. Enumerated values: physical, logical, snapshot.
- base_
backup_ floatretention_ period - Data backup retention period in days. Value range: [0, 30000).
- log_
backup_ floatretention_ period - Log backup retention period in days. Value range: 7-1830.
- max_
backup_ strstart_ time - The latest time to start a backup.
- min_
backup_ strstart_ time - The earliest time to start a backup.
- postgresql_
backup_ strplan_ id - ID of the resource.
- backup
Period StringType - Backup period type, currently only supports month.
- backup
Periods List<String> - Backup dates, such as backing up on the 2nd of each month.
- db
Instance StringId - Instance ID.
- plan
Name String - Backup plan name.
- backup
Method String - Backup method. Enumerated values: physical, logical, snapshot.
- base
Backup NumberRetention Period - Data backup retention period in days. Value range: [0, 30000).
- log
Backup NumberRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup StringStart Time - The latest time to start a backup.
- min
Backup StringStart Time - The earliest time to start a backup.
- postgresql
Backup StringPlan Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresqlBackupPlan resource produces the following output properties:
Look up Existing PostgresqlBackupPlan Resource
Get an existing PostgresqlBackupPlan 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?: PostgresqlBackupPlanState, opts?: CustomResourceOptions): PostgresqlBackupPlan@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backup_method: Optional[str] = None,
backup_period_type: Optional[str] = None,
backup_periods: Optional[Sequence[str]] = None,
base_backup_retention_period: Optional[float] = None,
db_instance_id: Optional[str] = None,
log_backup_retention_period: Optional[float] = None,
max_backup_start_time: Optional[str] = None,
min_backup_start_time: Optional[str] = None,
plan_id: Optional[str] = None,
plan_name: Optional[str] = None,
postgresql_backup_plan_id: Optional[str] = None) -> PostgresqlBackupPlanfunc GetPostgresqlBackupPlan(ctx *Context, name string, id IDInput, state *PostgresqlBackupPlanState, opts ...ResourceOption) (*PostgresqlBackupPlan, error)public static PostgresqlBackupPlan Get(string name, Input<string> id, PostgresqlBackupPlanState? state, CustomResourceOptions? opts = null)public static PostgresqlBackupPlan get(String name, Output<String> id, PostgresqlBackupPlanState state, CustomResourceOptions options)resources: _: type: tencentcloud:PostgresqlBackupPlan get: id: ${id}import {
to = tencentcloud_postgresql_backup_plan.example
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.
- Backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- Backup
Period stringType - Backup period type, currently only supports month.
- Backup
Periods List<string> - Backup dates, such as backing up on the 2nd of each month.
- Base
Backup doubleRetention Period - Data backup retention period in days. Value range: [0, 30000).
- Db
Instance stringId - Instance ID.
- Log
Backup doubleRetention Period - Log backup retention period in days. Value range: 7-1830.
- Max
Backup stringStart Time - The latest time to start a backup.
- Min
Backup stringStart Time - The earliest time to start a backup.
- Plan
Id string - Backup plan ID.
- Plan
Name string - Backup plan name.
- Postgresql
Backup stringPlan Id - ID of the resource.
- Backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- Backup
Period stringType - Backup period type, currently only supports month.
- Backup
Periods []string - Backup dates, such as backing up on the 2nd of each month.
- Base
Backup float64Retention Period - Data backup retention period in days. Value range: [0, 30000).
- Db
Instance stringId - Instance ID.
- Log
Backup float64Retention Period - Log backup retention period in days. Value range: 7-1830.
- Max
Backup stringStart Time - The latest time to start a backup.
- Min
Backup stringStart Time - The earliest time to start a backup.
- Plan
Id string - Backup plan ID.
- Plan
Name string - Backup plan name.
- Postgresql
Backup stringPlan Id - ID of the resource.
- backup_
method string - Backup method. Enumerated values: physical, logical, snapshot.
- backup_
period_ stringtype - Backup period type, currently only supports month.
- backup_
periods list(string) - Backup dates, such as backing up on the 2nd of each month.
- base_
backup_ numberretention_ period - Data backup retention period in days. Value range: [0, 30000).
- db_
instance_ stringid - Instance ID.
- log_
backup_ numberretention_ period - Log backup retention period in days. Value range: 7-1830.
- max_
backup_ stringstart_ time - The latest time to start a backup.
- min_
backup_ stringstart_ time - The earliest time to start a backup.
- plan_
id string - Backup plan ID.
- plan_
name string - Backup plan name.
- postgresql_
backup_ stringplan_ id - ID of the resource.
- backup
Method String - Backup method. Enumerated values: physical, logical, snapshot.
- backup
Period StringType - Backup period type, currently only supports month.
- backup
Periods List<String> - Backup dates, such as backing up on the 2nd of each month.
- base
Backup DoubleRetention Period - Data backup retention period in days. Value range: [0, 30000).
- db
Instance StringId - Instance ID.
- log
Backup DoubleRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup StringStart Time - The latest time to start a backup.
- min
Backup StringStart Time - The earliest time to start a backup.
- plan
Id String - Backup plan ID.
- plan
Name String - Backup plan name.
- postgresql
Backup StringPlan Id - ID of the resource.
- backup
Method string - Backup method. Enumerated values: physical, logical, snapshot.
- backup
Period stringType - Backup period type, currently only supports month.
- backup
Periods string[] - Backup dates, such as backing up on the 2nd of each month.
- base
Backup numberRetention Period - Data backup retention period in days. Value range: [0, 30000).
- db
Instance stringId - Instance ID.
- log
Backup numberRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup stringStart Time - The latest time to start a backup.
- min
Backup stringStart Time - The earliest time to start a backup.
- plan
Id string - Backup plan ID.
- plan
Name string - Backup plan name.
- postgresql
Backup stringPlan Id - ID of the resource.
- backup_
method str - Backup method. Enumerated values: physical, logical, snapshot.
- backup_
period_ strtype - Backup period type, currently only supports month.
- backup_
periods Sequence[str] - Backup dates, such as backing up on the 2nd of each month.
- base_
backup_ floatretention_ period - Data backup retention period in days. Value range: [0, 30000).
- db_
instance_ strid - Instance ID.
- log_
backup_ floatretention_ period - Log backup retention period in days. Value range: 7-1830.
- max_
backup_ strstart_ time - The latest time to start a backup.
- min_
backup_ strstart_ time - The earliest time to start a backup.
- plan_
id str - Backup plan ID.
- plan_
name str - Backup plan name.
- postgresql_
backup_ strplan_ id - ID of the resource.
- backup
Method String - Backup method. Enumerated values: physical, logical, snapshot.
- backup
Period StringType - Backup period type, currently only supports month.
- backup
Periods List<String> - Backup dates, such as backing up on the 2nd of each month.
- base
Backup NumberRetention Period - Data backup retention period in days. Value range: [0, 30000).
- db
Instance StringId - Instance ID.
- log
Backup NumberRetention Period - Log backup retention period in days. Value range: 7-1830.
- max
Backup StringStart Time - The latest time to start a backup.
- min
Backup StringStart Time - The earliest time to start a backup.
- plan
Id String - Backup plan ID.
- plan
Name String - Backup plan name.
- postgresql
Backup StringPlan Id - ID of the resource.
Import
PostgreSQL backup plan can be imported using the db_instance_id#plan_id, e.g.
$ pulumi import tencentcloud:index/postgresqlBackupPlan:PostgresqlBackupPlan example postgres-ckwcgdf1#0ba458c5-2468-5804-ab50-ca556e88c6a3
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
published on Friday, Jul 24, 2026 by tencentcloudstack