1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. PostgresqlBackupPlan
Viewing docs for tencentcloud 1.83.13
published on Monday, Jul 20, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.13
published on Monday, Jul 20, 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_postgresqlbackupplan" "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:

    BackupPeriodType string
    Backup period type, currently only supports month.
    BackupPeriods List<string>
    Backup dates, such as backing up on the 2nd of each month.
    DbInstanceId string
    Instance ID.
    PlanName string
    Backup plan name.
    BackupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    BaseBackupRetentionPeriod double
    Data backup retention period in days. Value range: [0, 30000).
    LogBackupRetentionPeriod double
    Log backup retention period in days. Value range: 7-1830.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanId string
    ID of the resource.
    BackupPeriodType string
    Backup period type, currently only supports month.
    BackupPeriods []string
    Backup dates, such as backing up on the 2nd of each month.
    DbInstanceId string
    Instance ID.
    PlanName string
    Backup plan name.
    BackupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    BaseBackupRetentionPeriod float64
    Data backup retention period in days. Value range: [0, 30000).
    LogBackupRetentionPeriod float64
    Log backup retention period in days. Value range: 7-1830.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanId string
    ID of the resource.
    backup_period_type string
    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_id string
    Instance ID.
    plan_name string
    Backup plan name.
    backup_method string
    Backup method. Enumerated values: physical, logical, snapshot.
    base_backup_retention_period number
    Data backup retention period in days. Value range: [0, 30000).
    log_backup_retention_period number
    Log backup retention period in days. Value range: 7-1830.
    max_backup_start_time string
    The latest time to start a backup.
    min_backup_start_time string
    The earliest time to start a backup.
    postgresql_backup_plan_id string
    ID of the resource.
    backupPeriodType String
    Backup period type, currently only supports month.
    backupPeriods List<String>
    Backup dates, such as backing up on the 2nd of each month.
    dbInstanceId String
    Instance ID.
    planName String
    Backup plan name.
    backupMethod String
    Backup method. Enumerated values: physical, logical, snapshot.
    baseBackupRetentionPeriod Double
    Data backup retention period in days. Value range: [0, 30000).
    logBackupRetentionPeriod Double
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanId String
    ID of the resource.
    backupPeriodType string
    Backup period type, currently only supports month.
    backupPeriods string[]
    Backup dates, such as backing up on the 2nd of each month.
    dbInstanceId string
    Instance ID.
    planName string
    Backup plan name.
    backupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    baseBackupRetentionPeriod number
    Data backup retention period in days. Value range: [0, 30000).
    logBackupRetentionPeriod number
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime string
    The latest time to start a backup.
    minBackupStartTime string
    The earliest time to start a backup.
    postgresqlBackupPlanId string
    ID of the resource.
    backup_period_type str
    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_id str
    Instance ID.
    plan_name str
    Backup plan name.
    backup_method str
    Backup method. Enumerated values: physical, logical, snapshot.
    base_backup_retention_period float
    Data backup retention period in days. Value range: [0, 30000).
    log_backup_retention_period float
    Log backup retention period in days. Value range: 7-1830.
    max_backup_start_time str
    The latest time to start a backup.
    min_backup_start_time str
    The earliest time to start a backup.
    postgresql_backup_plan_id str
    ID of the resource.
    backupPeriodType String
    Backup period type, currently only supports month.
    backupPeriods List<String>
    Backup dates, such as backing up on the 2nd of each month.
    dbInstanceId String
    Instance ID.
    planName String
    Backup plan name.
    backupMethod String
    Backup method. Enumerated values: physical, logical, snapshot.
    baseBackupRetentionPeriod Number
    Data backup retention period in days. Value range: [0, 30000).
    logBackupRetentionPeriod Number
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PostgresqlBackupPlan resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    PlanId string
    Backup plan ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    PlanId string
    Backup plan ID.
    id string
    The provider-assigned unique ID for this managed resource.
    plan_id string
    Backup plan ID.
    id String
    The provider-assigned unique ID for this managed resource.
    planId String
    Backup plan ID.
    id string
    The provider-assigned unique ID for this managed resource.
    planId string
    Backup plan ID.
    id str
    The provider-assigned unique ID for this managed resource.
    plan_id str
    Backup plan ID.
    id String
    The provider-assigned unique ID for this managed resource.
    planId String
    Backup plan ID.

    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) -> PostgresqlBackupPlan
    func 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_postgresqlbackupplan.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.
    The following state arguments are supported:
    BackupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    BackupPeriodType string
    Backup period type, currently only supports month.
    BackupPeriods List<string>
    Backup dates, such as backing up on the 2nd of each month.
    BaseBackupRetentionPeriod double
    Data backup retention period in days. Value range: [0, 30000).
    DbInstanceId string
    Instance ID.
    LogBackupRetentionPeriod double
    Log backup retention period in days. Value range: 7-1830.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PlanId string
    Backup plan ID.
    PlanName string
    Backup plan name.
    PostgresqlBackupPlanId string
    ID of the resource.
    BackupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    BackupPeriodType string
    Backup period type, currently only supports month.
    BackupPeriods []string
    Backup dates, such as backing up on the 2nd of each month.
    BaseBackupRetentionPeriod float64
    Data backup retention period in days. Value range: [0, 30000).
    DbInstanceId string
    Instance ID.
    LogBackupRetentionPeriod float64
    Log backup retention period in days. Value range: 7-1830.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PlanId string
    Backup plan ID.
    PlanName string
    Backup plan name.
    PostgresqlBackupPlanId string
    ID of the resource.
    backup_method string
    Backup method. Enumerated values: physical, logical, snapshot.
    backup_period_type string
    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_retention_period number
    Data backup retention period in days. Value range: [0, 30000).
    db_instance_id string
    Instance ID.
    log_backup_retention_period number
    Log backup retention period in days. Value range: 7-1830.
    max_backup_start_time string
    The latest time to start a backup.
    min_backup_start_time string
    The earliest time to start a backup.
    plan_id string
    Backup plan ID.
    plan_name string
    Backup plan name.
    postgresql_backup_plan_id string
    ID of the resource.
    backupMethod String
    Backup method. Enumerated values: physical, logical, snapshot.
    backupPeriodType String
    Backup period type, currently only supports month.
    backupPeriods List<String>
    Backup dates, such as backing up on the 2nd of each month.
    baseBackupRetentionPeriod Double
    Data backup retention period in days. Value range: [0, 30000).
    dbInstanceId String
    Instance ID.
    logBackupRetentionPeriod Double
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    planId String
    Backup plan ID.
    planName String
    Backup plan name.
    postgresqlBackupPlanId String
    ID of the resource.
    backupMethod string
    Backup method. Enumerated values: physical, logical, snapshot.
    backupPeriodType string
    Backup period type, currently only supports month.
    backupPeriods string[]
    Backup dates, such as backing up on the 2nd of each month.
    baseBackupRetentionPeriod number
    Data backup retention period in days. Value range: [0, 30000).
    dbInstanceId string
    Instance ID.
    logBackupRetentionPeriod number
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime string
    The latest time to start a backup.
    minBackupStartTime string
    The earliest time to start a backup.
    planId string
    Backup plan ID.
    planName string
    Backup plan name.
    postgresqlBackupPlanId string
    ID of the resource.
    backup_method str
    Backup method. Enumerated values: physical, logical, snapshot.
    backup_period_type str
    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_retention_period float
    Data backup retention period in days. Value range: [0, 30000).
    db_instance_id str
    Instance ID.
    log_backup_retention_period float
    Log backup retention period in days. Value range: 7-1830.
    max_backup_start_time str
    The latest time to start a backup.
    min_backup_start_time str
    The earliest time to start a backup.
    plan_id str
    Backup plan ID.
    plan_name str
    Backup plan name.
    postgresql_backup_plan_id str
    ID of the resource.
    backupMethod String
    Backup method. Enumerated values: physical, logical, snapshot.
    backupPeriodType String
    Backup period type, currently only supports month.
    backupPeriods List<String>
    Backup dates, such as backing up on the 2nd of each month.
    baseBackupRetentionPeriod Number
    Data backup retention period in days. Value range: [0, 30000).
    dbInstanceId String
    Instance ID.
    logBackupRetentionPeriod Number
    Log backup retention period in days. Value range: 7-1830.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    planId String
    Backup plan ID.
    planName String
    Backup plan name.
    postgresqlBackupPlanId String
    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 tencentcloud Terraform Provider.
    Viewing docs for tencentcloud 1.83.13
    published on Monday, Jul 20, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial