1. Packages
  2. Packages
  3. Planetscale Provider
  4. API Docs
  5. VitessBackupPolicy
Viewing docs for planetscale 1.2.0
published on Tuesday, Jun 16, 2026 by planetscale
Viewing docs for planetscale 1.2.0
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.
    FrequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    FrequencyValue double
    A number value for the frequency of the backup policy
    Name string
    The name of the backup policy
    RetentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    RetentionValue double
    A number value for the retention period of the backup policy
    ScheduleDay double
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    ScheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    ScheduleWeek 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.
    FrequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    FrequencyValue float64
    A number value for the frequency of the backup policy
    Name string
    The name of the backup policy
    RetentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    RetentionValue float64
    A number value for the retention period of the backup policy
    ScheduleDay float64
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    ScheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    ScheduleWeek 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.
    frequencyUnit String
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue Double
    A number value for the frequency of the backup policy
    name String
    The name of the backup policy
    retentionUnit String
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue Double
    A number value for the retention period of the backup policy
    scheduleDay Double
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime String
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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.
    frequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue number
    A number value for the frequency of the backup policy
    name string
    The name of the backup policy
    retentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue number
    A number value for the retention period of the backup policy
    scheduleDay number
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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.
    frequencyUnit String
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue Number
    A number value for the frequency of the backup policy
    name String
    The name of the backup policy
    retentionUnit String
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue Number
    A number value for the retention period of the backup policy
    scheduleDay Number
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime String
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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:

    DisplayName string
    The display name of the backup policy
    Id string
    The provider-assigned unique ID for this managed resource.
    DisplayName 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.
    displayName String
    The display name of the backup policy
    id String
    The provider-assigned unique ID for this managed resource.
    displayName 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.
    displayName 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) -> VitessBackupPolicy
    func 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.
    The following state arguments are supported:
    Database string
    Database name slug from list_databases. Example: app-db.
    DisplayName string
    The display name of the backup policy
    FrequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    FrequencyValue 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.
    RetentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    RetentionValue double
    A number value for the retention period of the backup policy
    ScheduleDay double
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    ScheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    ScheduleWeek 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.
    DisplayName string
    The display name of the backup policy
    FrequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    FrequencyValue 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.
    RetentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    RetentionValue float64
    A number value for the retention period of the backup policy
    ScheduleDay float64
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    ScheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    ScheduleWeek 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.
    displayName String
    The display name of the backup policy
    frequencyUnit String
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue 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.
    retentionUnit String
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue Double
    A number value for the retention period of the backup policy
    scheduleDay Double
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime String
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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.
    displayName string
    The display name of the backup policy
    frequencyUnit string
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue 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.
    retentionUnit string
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue number
    A number value for the retention period of the backup policy
    scheduleDay number
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime string
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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.
    displayName String
    The display name of the backup policy
    frequencyUnit String
    The unit for the frequency of the backup policy. must be one of ["hour", "day", "week", "month"]
    frequencyValue 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.
    retentionUnit String
    The unit for the retention period of the backup policy. must be one of ["hour", "day", "week", "month", "year"]
    retentionValue Number
    A number value for the retention period of the backup policy
    scheduleDay Number
    Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
    scheduleTime String
    The time of day that the backup is scheduled, in HH:MM format
    scheduleWeek 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 planetscale Terraform Provider.
    Viewing docs for planetscale 1.2.0
    published on Tuesday, Jun 16, 2026 by planetscale

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial