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

tencentcloud.PostgresqlBackupPlanConfig

Explore with Pulumi AI

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

    Provides a resource to create a postgres backup_plan_config

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const backupPlanConfig = new tencentcloud.PostgresqlBackupPlanConfig("backupPlanConfig", {
        dbInstanceId: local.pgsql_id,
        minBackupStartTime: "01:00:00",
        maxBackupStartTime: "02:00:00",
        baseBackupRetentionPeriod: 7,
        backupPeriods: [
            "monday",
            "wednesday",
            "friday",
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    backup_plan_config = tencentcloud.PostgresqlBackupPlanConfig("backupPlanConfig",
        db_instance_id=local["pgsql_id"],
        min_backup_start_time="01:00:00",
        max_backup_start_time="02:00:00",
        base_backup_retention_period=7,
        backup_periods=[
            "monday",
            "wednesday",
            "friday",
        ])
    
    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.NewPostgresqlBackupPlanConfig(ctx, "backupPlanConfig", &tencentcloud.PostgresqlBackupPlanConfigArgs{
    			DbInstanceId:              pulumi.Any(local.Pgsql_id),
    			MinBackupStartTime:        pulumi.String("01:00:00"),
    			MaxBackupStartTime:        pulumi.String("02:00:00"),
    			BaseBackupRetentionPeriod: pulumi.Float64(7),
    			BackupPeriods: pulumi.StringArray{
    				pulumi.String("monday"),
    				pulumi.String("wednesday"),
    				pulumi.String("friday"),
    			},
    		})
    		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 backupPlanConfig = new Tencentcloud.PostgresqlBackupPlanConfig("backupPlanConfig", new()
        {
            DbInstanceId = local.Pgsql_id,
            MinBackupStartTime = "01:00:00",
            MaxBackupStartTime = "02:00:00",
            BaseBackupRetentionPeriod = 7,
            BackupPeriods = new[]
            {
                "monday",
                "wednesday",
                "friday",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresqlBackupPlanConfig;
    import com.pulumi.tencentcloud.PostgresqlBackupPlanConfigArgs;
    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 backupPlanConfig = new PostgresqlBackupPlanConfig("backupPlanConfig", PostgresqlBackupPlanConfigArgs.builder()
                .dbInstanceId(local.pgsql_id())
                .minBackupStartTime("01:00:00")
                .maxBackupStartTime("02:00:00")
                .baseBackupRetentionPeriod(7)
                .backupPeriods(            
                    "monday",
                    "wednesday",
                    "friday")
                .build());
    
        }
    }
    
    resources:
      backupPlanConfig:
        type: tencentcloud:PostgresqlBackupPlanConfig
        properties:
          dbInstanceId: ${local.pgsql_id}
          minBackupStartTime: 01:00:00
          maxBackupStartTime: 02:00:00
          baseBackupRetentionPeriod: 7
          backupPeriods:
            - monday
            - wednesday
            - friday
    

    Create PostgresqlBackupPlanConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PostgresqlBackupPlanConfig(name: string, args: PostgresqlBackupPlanConfigArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresqlBackupPlanConfig(resource_name: str,
                                   args: PostgresqlBackupPlanConfigArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresqlBackupPlanConfig(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   db_instance_id: Optional[str] = None,
                                   backup_periods: Optional[Sequence[str]] = None,
                                   base_backup_retention_period: Optional[float] = None,
                                   max_backup_start_time: Optional[str] = None,
                                   min_backup_start_time: Optional[str] = None,
                                   postgresql_backup_plan_config_id: Optional[str] = None)
    func NewPostgresqlBackupPlanConfig(ctx *Context, name string, args PostgresqlBackupPlanConfigArgs, opts ...ResourceOption) (*PostgresqlBackupPlanConfig, error)
    public PostgresqlBackupPlanConfig(string name, PostgresqlBackupPlanConfigArgs args, CustomResourceOptions? opts = null)
    public PostgresqlBackupPlanConfig(String name, PostgresqlBackupPlanConfigArgs args)
    public PostgresqlBackupPlanConfig(String name, PostgresqlBackupPlanConfigArgs args, CustomResourceOptions options)
    
    type: tencentcloud:PostgresqlBackupPlanConfig
    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 PostgresqlBackupPlanConfigArgs
    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 PostgresqlBackupPlanConfigArgs
    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 PostgresqlBackupPlanConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresqlBackupPlanConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresqlBackupPlanConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PostgresqlBackupPlanConfig 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 PostgresqlBackupPlanConfig resource accepts the following input properties:

    DbInstanceId string
    instance id.
    BackupPeriods List<string>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    BaseBackupRetentionPeriod double
    Backup retention period in days. Value range:3-7.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanConfigId string
    ID of the resource.
    DbInstanceId string
    instance id.
    BackupPeriods []string
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    BaseBackupRetentionPeriod float64
    Backup retention period in days. Value range:3-7.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanConfigId string
    ID of the resource.
    dbInstanceId String
    instance id.
    backupPeriods List<String>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod Double
    Backup retention period in days. Value range:3-7.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId String
    ID of the resource.
    dbInstanceId string
    instance id.
    backupPeriods string[]
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod number
    Backup retention period in days. Value range:3-7.
    maxBackupStartTime string
    The latest time to start a backup.
    minBackupStartTime string
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId string
    ID of the resource.
    db_instance_id str
    instance id.
    backup_periods Sequence[str]
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    base_backup_retention_period float
    Backup retention period in days. Value range:3-7.
    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_config_id str
    ID of the resource.
    dbInstanceId String
    instance id.
    backupPeriods List<String>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod Number
    Backup retention period in days. Value range:3-7.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId String
    ID of the resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PostgresqlBackupPlanConfig Resource

    Get an existing PostgresqlBackupPlanConfig 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?: PostgresqlBackupPlanConfigState, opts?: CustomResourceOptions): PostgresqlBackupPlanConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backup_periods: Optional[Sequence[str]] = None,
            base_backup_retention_period: Optional[float] = None,
            db_instance_id: Optional[str] = None,
            max_backup_start_time: Optional[str] = None,
            min_backup_start_time: Optional[str] = None,
            postgresql_backup_plan_config_id: Optional[str] = None) -> PostgresqlBackupPlanConfig
    func GetPostgresqlBackupPlanConfig(ctx *Context, name string, id IDInput, state *PostgresqlBackupPlanConfigState, opts ...ResourceOption) (*PostgresqlBackupPlanConfig, error)
    public static PostgresqlBackupPlanConfig Get(string name, Input<string> id, PostgresqlBackupPlanConfigState? state, CustomResourceOptions? opts = null)
    public static PostgresqlBackupPlanConfig get(String name, Output<String> id, PostgresqlBackupPlanConfigState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:PostgresqlBackupPlanConfig    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.
    The following state arguments are supported:
    BackupPeriods List<string>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    BaseBackupRetentionPeriod double
    Backup retention period in days. Value range:3-7.
    DbInstanceId string
    instance id.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanConfigId string
    ID of the resource.
    BackupPeriods []string
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    BaseBackupRetentionPeriod float64
    Backup retention period in days. Value range:3-7.
    DbInstanceId string
    instance id.
    MaxBackupStartTime string
    The latest time to start a backup.
    MinBackupStartTime string
    The earliest time to start a backup.
    PostgresqlBackupPlanConfigId string
    ID of the resource.
    backupPeriods List<String>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod Double
    Backup retention period in days. Value range:3-7.
    dbInstanceId String
    instance id.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId String
    ID of the resource.
    backupPeriods string[]
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod number
    Backup retention period in days. Value range:3-7.
    dbInstanceId string
    instance id.
    maxBackupStartTime string
    The latest time to start a backup.
    minBackupStartTime string
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId string
    ID of the resource.
    backup_periods Sequence[str]
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    base_backup_retention_period float
    Backup retention period in days. Value range:3-7.
    db_instance_id str
    instance id.
    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_config_id str
    ID of the resource.
    backupPeriods List<String>
    Backup cycle, which means on which days each week the instance will be backed up. The parameter value should be the lowercase names of the days of the week.
    baseBackupRetentionPeriod Number
    Backup retention period in days. Value range:3-7.
    dbInstanceId String
    instance id.
    maxBackupStartTime String
    The latest time to start a backup.
    minBackupStartTime String
    The earliest time to start a backup.
    postgresqlBackupPlanConfigId String
    ID of the resource.

    Import

    postgres backup_plan_config can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/postgresqlBackupPlanConfig:PostgresqlBackupPlanConfig backup_plan_config backup_plan_config_id
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack