tencentcloud.PostgresqlBackupPlanConfig
Explore with Pulumi AI
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:
- Db
Instance stringId - instance id.
- Backup
Periods 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.
- Base
Backup doubleRetention Period - Backup retention period in days. Value range:3-7.
- 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 Config Id - ID of the resource.
- Db
Instance stringId - instance id.
- Backup
Periods []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.
- Base
Backup float64Retention Period - Backup retention period in days. Value range:3-7.
- 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 Config Id - ID of the resource.
- db
Instance StringId - instance id.
- backup
Periods 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.
- base
Backup DoubleRetention Period - Backup retention period in days. Value range:3-7.
- 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 Config Id - ID of the resource.
- db
Instance stringId - instance id.
- backup
Periods 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.
- base
Backup numberRetention Period - Backup retention period in days. Value range:3-7.
- 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 Config Id - ID of the resource.
- db_
instance_ strid - 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_ floatretention_ period - Backup retention period in days. Value range:3-7.
- 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_ config_ id - ID of the resource.
- db
Instance StringId - instance id.
- backup
Periods 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.
- base
Backup NumberRetention Period - Backup retention period in days. Value range:3-7.
- 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 Config Id - 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.
- Backup
Periods 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.
- Base
Backup doubleRetention Period - Backup retention period in days. Value range:3-7.
- Db
Instance stringId - instance id.
- 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 Config Id - ID of the resource.
- Backup
Periods []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.
- Base
Backup float64Retention Period - Backup retention period in days. Value range:3-7.
- Db
Instance stringId - instance id.
- 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 Config Id - ID of the resource.
- backup
Periods 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.
- base
Backup DoubleRetention Period - Backup retention period in days. Value range:3-7.
- db
Instance StringId - instance id.
- 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 Config Id - ID of the resource.
- backup
Periods 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.
- base
Backup numberRetention Period - Backup retention period in days. Value range:3-7.
- db
Instance stringId - instance id.
- 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 Config Id - 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_ floatretention_ period - Backup retention period in days. Value range:3-7.
- db_
instance_ strid - instance id.
- 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_ config_ id - ID of the resource.
- backup
Periods 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.
- base
Backup NumberRetention Period - Backup retention period in days. Value range:3-7.
- db
Instance StringId - instance id.
- 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 Config Id - 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.