published on Tuesday, Jun 16, 2026 by planetscale
published on Tuesday, Jun 16, 2026 by planetscale
VitessBackupPolicy Resource
Create VitessBackupPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VitessBackupPolicy(name: string, args: VitessBackupPolicyArgs, opts?: CustomResourceOptions);@overload
def VitessBackupPolicy(resource_name: str,
args: VitessBackupPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VitessBackupPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
database: Optional[str] = None,
organization: Optional[str] = None,
frequency_unit: Optional[str] = None,
frequency_value: Optional[float] = None,
name: Optional[str] = None,
retention_unit: Optional[str] = None,
retention_value: Optional[float] = None,
schedule_day: Optional[float] = None,
schedule_time: Optional[str] = None,
schedule_week: Optional[float] = None,
target: Optional[str] = None)func NewVitessBackupPolicy(ctx *Context, name string, args VitessBackupPolicyArgs, opts ...ResourceOption) (*VitessBackupPolicy, error)public VitessBackupPolicy(string name, VitessBackupPolicyArgs args, CustomResourceOptions? opts = null)
public VitessBackupPolicy(String name, VitessBackupPolicyArgs args)
public VitessBackupPolicy(String name, VitessBackupPolicyArgs args, CustomResourceOptions options)
type: planetscale:VitessBackupPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "planetscale_vitessbackuppolicy" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args VitessBackupPolicyArgs
- 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 VitessBackupPolicyArgs
- 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 VitessBackupPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VitessBackupPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VitessBackupPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var vitessBackupPolicyResource = new Planetscale.VitessBackupPolicy("vitessBackupPolicyResource", new()
{
Database = "string",
Organization = "string",
FrequencyUnit = "string",
FrequencyValue = 0,
Name = "string",
RetentionUnit = "string",
RetentionValue = 0,
ScheduleDay = 0,
ScheduleTime = "string",
ScheduleWeek = 0,
Target = "string",
});
example, err := planetscale.NewVitessBackupPolicy(ctx, "vitessBackupPolicyResource", &planetscale.VitessBackupPolicyArgs{
Database: pulumi.String("string"),
Organization: pulumi.String("string"),
FrequencyUnit: pulumi.String("string"),
FrequencyValue: pulumi.Float64(0),
Name: pulumi.String("string"),
RetentionUnit: pulumi.String("string"),
RetentionValue: pulumi.Float64(0),
ScheduleDay: pulumi.Float64(0),
ScheduleTime: pulumi.String("string"),
ScheduleWeek: pulumi.Float64(0),
Target: pulumi.String("string"),
})
resource "planetscale_vitessbackuppolicy" "vitessBackupPolicyResource" {
database = "string"
organization = "string"
frequency_unit = "string"
frequency_value = 0
name = "string"
retention_unit = "string"
retention_value = 0
schedule_day = 0
schedule_time = "string"
schedule_week = 0
target = "string"
}
var vitessBackupPolicyResource = new VitessBackupPolicy("vitessBackupPolicyResource", VitessBackupPolicyArgs.builder()
.database("string")
.organization("string")
.frequencyUnit("string")
.frequencyValue(0.0)
.name("string")
.retentionUnit("string")
.retentionValue(0.0)
.scheduleDay(0.0)
.scheduleTime("string")
.scheduleWeek(0.0)
.target("string")
.build());
vitess_backup_policy_resource = planetscale.VitessBackupPolicy("vitessBackupPolicyResource",
database="string",
organization="string",
frequency_unit="string",
frequency_value=float(0),
name="string",
retention_unit="string",
retention_value=float(0),
schedule_day=float(0),
schedule_time="string",
schedule_week=float(0),
target="string")
const vitessBackupPolicyResource = new planetscale.VitessBackupPolicy("vitessBackupPolicyResource", {
database: "string",
organization: "string",
frequencyUnit: "string",
frequencyValue: 0,
name: "string",
retentionUnit: "string",
retentionValue: 0,
scheduleDay: 0,
scheduleTime: "string",
scheduleWeek: 0,
target: "string",
});
type: planetscale:VitessBackupPolicy
properties:
database: string
frequencyUnit: string
frequencyValue: 0
name: string
organization: string
retentionUnit: string
retentionValue: 0
scheduleDay: 0
scheduleTime: string
scheduleWeek: 0
target: string
VitessBackupPolicy 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 VitessBackupPolicy resource accepts the following input properties:
- Database string
- Database name slug from
list_databases. Example:app-db. - Organization string
- Organization name slug from
list_organizations. Example:acme. - Frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- Frequency
Value double - A number value for the frequency of the backup policy
- Name string
- The name of the backup policy
- Retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- Retention
Value double - A number value for the retention period of the backup policy
- Schedule
Day double - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- Schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- Schedule
Week double - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- Target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- Database string
- Database name slug from
list_databases. Example:app-db. - Organization string
- Organization name slug from
list_organizations. Example:acme. - Frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- Frequency
Value float64 - A number value for the frequency of the backup policy
- Name string
- The name of the backup policy
- Retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- Retention
Value float64 - A number value for the retention period of the backup policy
- Schedule
Day float64 - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- Schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- Schedule
Week float64 - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- Target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database string
- Database name slug from
list_databases. Example:app-db. - organization string
- Organization name slug from
list_organizations. Example:acme. - frequency_
unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency_
value number - A number value for the frequency of the backup policy
- name string
- The name of the backup policy
- retention_
unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention_
value number - A number value for the retention period of the backup policy
- schedule_
day number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule_
time string - The time of day that the backup is scheduled, in HH:MM format
- schedule_
week number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database String
- Database name slug from
list_databases. Example:app-db. - organization String
- Organization name slug from
list_organizations. Example:acme. - frequency
Unit String - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value Double - A number value for the frequency of the backup policy
- name String
- The name of the backup policy
- retention
Unit String - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value Double - A number value for the retention period of the backup policy
- schedule
Day Double - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time String - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week Double - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target String
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database string
- Database name slug from
list_databases. Example:app-db. - organization string
- Organization name slug from
list_organizations. Example:acme. - frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value number - A number value for the frequency of the backup policy
- name string
- The name of the backup policy
- retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value number - A number value for the retention period of the backup policy
- schedule
Day number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database str
- Database name slug from
list_databases. Example:app-db. - organization str
- Organization name slug from
list_organizations. Example:acme. - frequency_
unit str - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency_
value float - A number value for the frequency of the backup policy
- name str
- The name of the backup policy
- retention_
unit str - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention_
value float - A number value for the retention period of the backup policy
- schedule_
day float - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule_
time str - The time of day that the backup is scheduled, in HH:MM format
- schedule_
week float - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target str
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database String
- Database name slug from
list_databases. Example:app-db. - organization String
- Organization name slug from
list_organizations. Example:acme. - frequency
Unit String - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value Number - A number value for the frequency of the backup policy
- name String
- The name of the backup policy
- retention
Unit String - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value Number - A number value for the retention period of the backup policy
- schedule
Day Number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time String - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week Number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target String
- Whether the policy is for production or development branches. must be one of ["production", "development"]
Outputs
All input properties are implicitly available as output properties. Additionally, the VitessBackupPolicy resource produces the following output properties:
- Display
Name string - The display name of the backup policy
- Id string
- The provider-assigned unique ID for this managed resource.
- Display
Name string - The display name of the backup policy
- Id string
- The provider-assigned unique ID for this managed resource.
- display_
name string - The display name of the backup policy
- id string
- The provider-assigned unique ID for this managed resource.
- display
Name String - The display name of the backup policy
- id String
- The provider-assigned unique ID for this managed resource.
- display
Name string - The display name of the backup policy
- id string
- The provider-assigned unique ID for this managed resource.
- display_
name str - The display name of the backup policy
- id str
- The provider-assigned unique ID for this managed resource.
- display
Name String - The display name of the backup policy
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing VitessBackupPolicy Resource
Get an existing VitessBackupPolicy 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?: VitessBackupPolicyState, opts?: CustomResourceOptions): VitessBackupPolicy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
database: Optional[str] = None,
display_name: Optional[str] = None,
frequency_unit: Optional[str] = None,
frequency_value: Optional[float] = None,
name: Optional[str] = None,
organization: Optional[str] = None,
retention_unit: Optional[str] = None,
retention_value: Optional[float] = None,
schedule_day: Optional[float] = None,
schedule_time: Optional[str] = None,
schedule_week: Optional[float] = None,
target: Optional[str] = None) -> VitessBackupPolicyfunc GetVitessBackupPolicy(ctx *Context, name string, id IDInput, state *VitessBackupPolicyState, opts ...ResourceOption) (*VitessBackupPolicy, error)public static VitessBackupPolicy Get(string name, Input<string> id, VitessBackupPolicyState? state, CustomResourceOptions? opts = null)public static VitessBackupPolicy get(String name, Output<String> id, VitessBackupPolicyState state, CustomResourceOptions options)resources: _: type: planetscale:VitessBackupPolicy get: id: ${id}import {
to = planetscale_vitessbackuppolicy.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.
- Database string
- Database name slug from
list_databases. Example:app-db. - Display
Name string - The display name of the backup policy
- Frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- Frequency
Value double - A number value for the frequency of the backup policy
- Name string
- The name of the backup policy
- Organization string
- Organization name slug from
list_organizations. Example:acme. - Retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- Retention
Value double - A number value for the retention period of the backup policy
- Schedule
Day double - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- Schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- Schedule
Week double - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- Target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- Database string
- Database name slug from
list_databases. Example:app-db. - Display
Name string - The display name of the backup policy
- Frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- Frequency
Value float64 - A number value for the frequency of the backup policy
- Name string
- The name of the backup policy
- Organization string
- Organization name slug from
list_organizations. Example:acme. - Retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- Retention
Value float64 - A number value for the retention period of the backup policy
- Schedule
Day float64 - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- Schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- Schedule
Week float64 - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- Target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database string
- Database name slug from
list_databases. Example:app-db. - display_
name string - The display name of the backup policy
- frequency_
unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency_
value number - A number value for the frequency of the backup policy
- name string
- The name of the backup policy
- organization string
- Organization name slug from
list_organizations. Example:acme. - retention_
unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention_
value number - A number value for the retention period of the backup policy
- schedule_
day number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule_
time string - The time of day that the backup is scheduled, in HH:MM format
- schedule_
week number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database String
- Database name slug from
list_databases. Example:app-db. - display
Name String - The display name of the backup policy
- frequency
Unit String - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value Double - A number value for the frequency of the backup policy
- name String
- The name of the backup policy
- organization String
- Organization name slug from
list_organizations. Example:acme. - retention
Unit String - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value Double - A number value for the retention period of the backup policy
- schedule
Day Double - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time String - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week Double - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target String
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database string
- Database name slug from
list_databases. Example:app-db. - display
Name string - The display name of the backup policy
- frequency
Unit string - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value number - A number value for the frequency of the backup policy
- name string
- The name of the backup policy
- organization string
- Organization name slug from
list_organizations. Example:acme. - retention
Unit string - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value number - A number value for the retention period of the backup policy
- schedule
Day number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time string - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target string
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database str
- Database name slug from
list_databases. Example:app-db. - display_
name str - The display name of the backup policy
- frequency_
unit str - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency_
value float - A number value for the frequency of the backup policy
- name str
- The name of the backup policy
- organization str
- Organization name slug from
list_organizations. Example:acme. - retention_
unit str - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention_
value float - A number value for the retention period of the backup policy
- schedule_
day float - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule_
time str - The time of day that the backup is scheduled, in HH:MM format
- schedule_
week float - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target str
- Whether the policy is for production or development branches. must be one of ["production", "development"]
- database String
- Database name slug from
list_databases. Example:app-db. - display
Name String - The display name of the backup policy
- frequency
Unit String - The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
- frequency
Value Number - A number value for the frequency of the backup policy
- name String
- The name of the backup policy
- organization String
- Organization name slug from
list_organizations. Example:acme. - retention
Unit String - The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
- retention
Value Number - A number value for the retention period of the backup policy
- schedule
Day Number - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
- schedule
Time String - The time of day that the backup is scheduled, in HH:MM format
- schedule
Week Number - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
- target String
- Whether the policy is for production or development branches. must be one of ["production", "development"]
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = planetscale_vitess_backup_policy.my_planetscale_vitess_backup_policy
id = jsonencode({
database = "..."
id = "..."
organization = "..."
})
}
The pulumi import command can be used, for example:
$ pulumi import planetscale:index/vitessBackupPolicy:VitessBackupPolicy my_planetscale_vitess_backup_policy '{"database": "...", "id": "...", "organization": "..."}'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- planetscale planetscale/terraform-provider-planetscale
- License
- Notes
- This Pulumi package is based on the
planetscaleTerraform Provider.
published on Tuesday, Jun 16, 2026 by planetscale