1. Registry
  2. Packages
  3. Snowflake Provider
  4. API Docs
  5. BackupPolicy
Viewing docs for Snowflake v2.23.0
published on Friday, Nov 6, 2026 by Pulumi
snowflake logo
Viewing docs for Snowflake v2.23.0
published on Friday, Nov 6, 2026 by Pulumi

    Caution: Preview Feature This feature is considered a preview feature in the provider, regardless of the state of the resource in Snowflake. We do not guarantee its stability. It will be reworked and marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add the relevant feature name to previewFeaturesEnabled field in the provider configuration. Please always refer to the Getting Help section in our Github repo to best determine how to get help for your questions.

    Resource used to manage backup policies. For more information, check backup policy documentation.

    Example Usage

    Note Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult identifiers guide.

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    //# Minimal
    // CREATE requires a schedule, an expiration, or both.
    const basic = new snowflake.BackupPolicy("basic", {
        database: "database_name",
        schema: "schema_name",
        name: "backup_policy_name",
        expireAfterDays: 7,
    });
    //# Complete
    // with_retention_lock cannot be changed after creation.
    const complete = new snowflake.BackupPolicy("complete", {
        database: "database_name",
        schema: "schema_name",
        name: "backup_policy_name",
        expireAfterDays: 7,
        withRetentionLock: "true",
        comment: "My backup policy",
        schedule: {
            hours: 2,
        },
    });
    //# Complete with a cron schedule
    const cron = new snowflake.BackupPolicy("cron", {
        database: "database_name",
        schema: "schema_name",
        name: "backup_policy_name_cron",
        expireAfterDays: 7,
        schedule: {
            usingCron: "0 0 * * * UTC",
        },
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    ## Minimal
    # CREATE requires a schedule, an expiration, or both.
    basic = snowflake.BackupPolicy("basic",
        database="database_name",
        schema="schema_name",
        name="backup_policy_name",
        expire_after_days=7)
    ## Complete
    # with_retention_lock cannot be changed after creation.
    complete = snowflake.BackupPolicy("complete",
        database="database_name",
        schema="schema_name",
        name="backup_policy_name",
        expire_after_days=7,
        with_retention_lock="true",
        comment="My backup policy",
        schedule={
            "hours": 2,
        })
    ## Complete with a cron schedule
    cron = snowflake.BackupPolicy("cron",
        database="database_name",
        schema="schema_name",
        name="backup_policy_name_cron",
        expire_after_days=7,
        schedule={
            "using_cron": "0 0 * * * UTC",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/v2/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		//# Minimal
    		// CREATE requires a schedule, an expiration, or both.
    		_, err := snowflake.NewBackupPolicy(ctx, "basic", &snowflake.BackupPolicyArgs{
    			Database:        pulumi.String("database_name"),
    			Schema:          pulumi.String("schema_name"),
    			Name:            pulumi.String("backup_policy_name"),
    			ExpireAfterDays: pulumi.Int(7),
    		})
    		if err != nil {
    			return err
    		}
    		//# Complete
    		// with_retention_lock cannot be changed after creation.
    		_, err = snowflake.NewBackupPolicy(ctx, "complete", &snowflake.BackupPolicyArgs{
    			Database:          pulumi.String("database_name"),
    			Schema:            pulumi.String("schema_name"),
    			Name:              pulumi.String("backup_policy_name"),
    			ExpireAfterDays:   pulumi.Int(7),
    			WithRetentionLock: pulumi.String("true"),
    			Comment:           pulumi.String("My backup policy"),
    			Schedule: &snowflake.BackupPolicyScheduleArgs{
    				Hours: pulumi.Int(2),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		//# Complete with a cron schedule
    		_, err = snowflake.NewBackupPolicy(ctx, "cron", &snowflake.BackupPolicyArgs{
    			Database:        pulumi.String("database_name"),
    			Schema:          pulumi.String("schema_name"),
    			Name:            pulumi.String("backup_policy_name_cron"),
    			ExpireAfterDays: pulumi.Int(7),
    			Schedule: &snowflake.BackupPolicyScheduleArgs{
    				UsingCron: pulumi.String("0 0 * * * UTC"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        //# Minimal
        // CREATE requires a schedule, an expiration, or both.
        var basic = new Snowflake.BackupPolicy("basic", new()
        {
            Database = "database_name",
            Schema = "schema_name",
            Name = "backup_policy_name",
            ExpireAfterDays = 7,
        });
    
        //# Complete
        // with_retention_lock cannot be changed after creation.
        var complete = new Snowflake.BackupPolicy("complete", new()
        {
            Database = "database_name",
            Schema = "schema_name",
            Name = "backup_policy_name",
            ExpireAfterDays = 7,
            WithRetentionLock = "true",
            Comment = "My backup policy",
            Schedule = new Snowflake.Inputs.BackupPolicyScheduleArgs
            {
                Hours = 2,
            },
        });
    
        //# Complete with a cron schedule
        var cron = new Snowflake.BackupPolicy("cron", new()
        {
            Database = "database_name",
            Schema = "schema_name",
            Name = "backup_policy_name_cron",
            ExpireAfterDays = 7,
            Schedule = new Snowflake.Inputs.BackupPolicyScheduleArgs
            {
                UsingCron = "0 0 * * * UTC",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.BackupPolicy;
    import com.pulumi.snowflake.BackupPolicyArgs;
    import com.pulumi.snowflake.inputs.BackupPolicyScheduleArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            //# Minimal
            // CREATE requires a schedule, an expiration, or both.
            var basic = new BackupPolicy("basic", BackupPolicyArgs.builder()
                .database("database_name")
                .schema("schema_name")
                .name("backup_policy_name")
                .expireAfterDays(7)
                .build());
    
            //# Complete
            // with_retention_lock cannot be changed after creation.
            var complete = new BackupPolicy("complete", BackupPolicyArgs.builder()
                .database("database_name")
                .schema("schema_name")
                .name("backup_policy_name")
                .expireAfterDays(7)
                .withRetentionLock("true")
                .comment("My backup policy")
                .schedule(BackupPolicyScheduleArgs.builder()
                    .hours(2)
                    .build())
                .build());
    
            //# Complete with a cron schedule
            var cron = new BackupPolicy("cron", BackupPolicyArgs.builder()
                .database("database_name")
                .schema("schema_name")
                .name("backup_policy_name_cron")
                .expireAfterDays(7)
                .schedule(BackupPolicyScheduleArgs.builder()
                    .usingCron("0 0 * * * UTC")
                    .build())
                .build());
    
        }
    }
    
    resources:
      ## Minimal
      # CREATE requires a schedule, an expiration, or both.
      basic:
        type: snowflake:BackupPolicy
        properties:
          database: database_name
          schema: schema_name
          name: backup_policy_name
          expireAfterDays: 7
      ## Complete
      # with_retention_lock cannot be changed after creation.
      complete:
        type: snowflake:BackupPolicy
        properties:
          database: database_name
          schema: schema_name
          name: backup_policy_name
          expireAfterDays: 7
          withRetentionLock: 'true'
          comment: My backup policy
          schedule:
            hours: 2
      ## Complete with a cron schedule
      cron:
        type: snowflake:BackupPolicy
        properties:
          database: database_name
          schema: schema_name
          name: backup_policy_name_cron
          expireAfterDays: 7
          schedule:
            usingCron: 0 0 * * * UTC
    
    terraform {
      required_providers {
        snowflake = {
          source = "pulumi/snowflake"
        }
      }
    }
    
    ## Minimal
    # CREATE requires a schedule, an expiration, or both.
    resource "snowflake_backup_policy" "basic" {
      lifecycle {
        create_before_destroy = true
      }
      database          = "database_name"
      schema            = "schema_name"
      name              = "backup_policy_name"
      expire_after_days = 7
    }
    ## Complete
    # with_retention_lock cannot be changed after creation.
    resource "snowflake_backup_policy" "complete" {
      lifecycle {
        create_before_destroy = true
      }
      database            = "database_name"
      schema              = "schema_name"
      name                = "backup_policy_name"
      expire_after_days   = 7
      with_retention_lock = "true"
      comment             = "My backup policy"
      schedule {
        hours = 2
      }
    }
    ## Complete with a cron schedule
    resource "snowflake_backup_policy" "cron" {
      lifecycle {
        create_before_destroy = true
      }
      database          = "database_name"
      schema            = "schema_name"
      name              = "backup_policy_name_cron"
      expire_after_days = 7
      schedule {
        using_cron = "0 0 * * * UTC"
      }
    }
    

    Note If a field has a default value, it is shown next to the type in the schema.

    Create BackupPolicy Resource

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

    Constructor syntax

    new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def BackupPolicy(resource_name: str,
                     args: BackupPolicyArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BackupPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     database: Optional[str] = None,
                     schema: Optional[str] = None,
                     comment: Optional[str] = None,
                     expire_after_days: Optional[int] = None,
                     name: Optional[str] = None,
                     schedule: Optional[BackupPolicyScheduleArgs] = None,
                     with_retention_lock: Optional[str] = None)
    func NewBackupPolicy(ctx *Context, name string, args BackupPolicyArgs, opts ...ResourceOption) (*BackupPolicy, error)
    public BackupPolicy(string name, BackupPolicyArgs args, CustomResourceOptions? opts = null)
    public BackupPolicy(String name, BackupPolicyArgs args)
    public BackupPolicy(String name, BackupPolicyArgs args, CustomResourceOptions options)
    
    type: snowflake:BackupPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "snowflake_backup_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args BackupPolicyArgs
    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 BackupPolicyArgs
    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 BackupPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BackupPolicyArgs
    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 backupPolicyResource = new Snowflake.BackupPolicy("backupPolicyResource", new()
    {
        Database = "string",
        Schema = "string",
        Comment = "string",
        ExpireAfterDays = 0,
        Name = "string",
        Schedule = new Snowflake.Inputs.BackupPolicyScheduleArgs
        {
            Hours = 0,
            Minutes = 0,
            UsingCron = "string",
        },
        WithRetentionLock = "string",
    });
    
    example, err := snowflake.NewBackupPolicy(ctx, "backupPolicyResource", &snowflake.BackupPolicyArgs{
    	Database:        pulumi.String("string"),
    	Schema:          pulumi.String("string"),
    	Comment:         pulumi.String("string"),
    	ExpireAfterDays: pulumi.Int(0),
    	Name:            pulumi.String("string"),
    	Schedule: &snowflake.BackupPolicyScheduleArgs{
    		Hours:     pulumi.Int(0),
    		Minutes:   pulumi.Int(0),
    		UsingCron: pulumi.String("string"),
    	},
    	WithRetentionLock: pulumi.String("string"),
    })
    
    resource "snowflake_backup_policy" "backupPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      database          = "string"
      schema            = "string"
      comment           = "string"
      expire_after_days = 0
      name              = "string"
      schedule = {
        hours      = 0
        minutes    = 0
        using_cron = "string"
      }
      with_retention_lock = "string"
    }
    
    var backupPolicyResource = new BackupPolicy("backupPolicyResource", BackupPolicyArgs.builder()
        .database("string")
        .schema("string")
        .comment("string")
        .expireAfterDays(0)
        .name("string")
        .schedule(BackupPolicyScheduleArgs.builder()
            .hours(0)
            .minutes(0)
            .usingCron("string")
            .build())
        .withRetentionLock("string")
        .build());
    
    backup_policy_resource = snowflake.BackupPolicy("backupPolicyResource",
        database="string",
        schema="string",
        comment="string",
        expire_after_days=0,
        name="string",
        schedule={
            "hours": 0,
            "minutes": 0,
            "using_cron": "string",
        },
        with_retention_lock="string")
    
    const backupPolicyResource = new snowflake.BackupPolicy("backupPolicyResource", {
        database: "string",
        schema: "string",
        comment: "string",
        expireAfterDays: 0,
        name: "string",
        schedule: {
            hours: 0,
            minutes: 0,
            usingCron: "string",
        },
        withRetentionLock: "string",
    });
    
    type: snowflake:BackupPolicy
    properties:
        comment: string
        database: string
        expireAfterDays: 0
        name: string
        schedule:
            hours: 0
            minutes: 0
            usingCron: string
        schema: string
        withRetentionLock: string
    

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

    Database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Comment string
    Specifies a comment for the backup policy.
    ExpireAfterDays int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    Name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    WithRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    Database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Comment string
    Specifies a comment for the backup policy.
    ExpireAfterDays int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    Name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schedule BackupPolicyScheduleArgs
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    WithRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment string
    Specifies a comment for the backup policy.
    expire_after_days number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule object
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    with_retention_lock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    database String
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment String
    Specifies a comment for the backup policy.
    expireAfterDays Integer
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    name String
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    withRetentionLock String
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment string
    Specifies a comment for the backup policy.
    expireAfterDays number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    withRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    database str
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema str
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment str
    Specifies a comment for the backup policy.
    expire_after_days int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    name str
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicyScheduleArgs
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    with_retention_lock str
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    database String
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment String
    Specifies a comment for the backup policy.
    expireAfterDays Number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    name String
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule Property Map
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    withRetentionLock String
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.

    Outputs

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

    DescribeOutputs List<BackupPolicyDescribeOutput>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    ShowOutputs List<BackupPolicyShowOutput>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    DescribeOutputs []BackupPolicyDescribeOutput
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    ShowOutputs []BackupPolicyShowOutput
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    describe_outputs list(object)
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    fully_qualified_name string
    Fully qualified name of the resource. For more information, see object name resolution.
    id string
    The provider-assigned unique ID for this managed resource.
    show_outputs list(object)
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    describeOutputs List<BackupPolicyDescribeOutput>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    showOutputs List<BackupPolicyShowOutput>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    describeOutputs BackupPolicyDescribeOutput[]
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    id string
    The provider-assigned unique ID for this managed resource.
    showOutputs BackupPolicyShowOutput[]
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    describe_outputs Sequence[BackupPolicyDescribeOutput]
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    id str
    The provider-assigned unique ID for this managed resource.
    show_outputs Sequence[BackupPolicyShowOutput]
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    describeOutputs List<Property Map>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    showOutputs List<Property Map>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.

    Look up Existing BackupPolicy Resource

    Get an existing BackupPolicy 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?: BackupPolicyState, opts?: CustomResourceOptions): BackupPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            database: Optional[str] = None,
            describe_outputs: Optional[Sequence[BackupPolicyDescribeOutputArgs]] = None,
            expire_after_days: Optional[int] = None,
            fully_qualified_name: Optional[str] = None,
            name: Optional[str] = None,
            schedule: Optional[BackupPolicyScheduleArgs] = None,
            schema: Optional[str] = None,
            show_outputs: Optional[Sequence[BackupPolicyShowOutputArgs]] = None,
            with_retention_lock: Optional[str] = None) -> BackupPolicy
    func GetBackupPolicy(ctx *Context, name string, id IDInput, state *BackupPolicyState, opts ...ResourceOption) (*BackupPolicy, error)
    public static BackupPolicy Get(string name, Input<string> id, BackupPolicyState? state, CustomResourceOptions? opts = null)
    public static BackupPolicy get(String name, Output<String> id, BackupPolicyState state, CustomResourceOptions options)
    resources:  _:    type: snowflake:BackupPolicy    get:      id: ${id}
    import {
      to = snowflake_backup_policy.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:
    Comment string
    Specifies a comment for the backup policy.
    Database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    DescribeOutputs List<BackupPolicyDescribeOutput>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    ExpireAfterDays int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    Schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs List<BackupPolicyShowOutput>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    WithRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    Comment string
    Specifies a comment for the backup policy.
    Database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    DescribeOutputs []BackupPolicyDescribeOutputArgs
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    ExpireAfterDays int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schedule BackupPolicyScheduleArgs
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    Schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs []BackupPolicyShowOutputArgs
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    WithRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    comment string
    Specifies a comment for the backup policy.
    database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describe_outputs list(object)
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    expire_after_days number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    fully_qualified_name string
    Fully qualified name of the resource. For more information, see object name resolution.
    name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule object
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    show_outputs list(object)
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    with_retention_lock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    comment String
    Specifies a comment for the backup policy.
    database String
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs List<BackupPolicyDescribeOutput>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    expireAfterDays Integer
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    name String
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    schema String
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<BackupPolicyShowOutput>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    withRetentionLock String
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    comment string
    Specifies a comment for the backup policy.
    database string
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs BackupPolicyDescribeOutput[]
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    expireAfterDays number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    name string
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicySchedule
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    schema string
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs BackupPolicyShowOutput[]
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    withRetentionLock string
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    comment str
    Specifies a comment for the backup policy.
    database str
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describe_outputs Sequence[BackupPolicyDescribeOutputArgs]
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    expire_after_days int
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    name str
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule BackupPolicyScheduleArgs
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    schema str
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    show_outputs Sequence[BackupPolicyShowOutputArgs]
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    with_retention_lock str
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.
    comment String
    Specifies a comment for the backup policy.
    database String
    The database in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs List<Property Map>
    Outputs the result of DESCRIBE BACKUP POLICY for the given backup policy.
    expireAfterDays Number
    Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    name String
    Specifies the identifier for the backup policy; must be unique for the schema in which the backup policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schedule Property Map
    Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (hours or minutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set.
    schema String
    The schema in which to create the backup policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<Property Map>
    Outputs the result of SHOW BACKUP POLICIES for the given backup policy.
    withRetentionLock String
    (Default: fallback to Snowflake default - uses special value that cannot be set in the configuration manually (default)) Specifies a retention lock. Backups created under the policy cannot be deleted before they expire, including by a privileged user. The lock cannot be changed on an existing backup policy. Available options are: "true" or "false". When the value is not set in the configuration the provider will put "default" there which means to use the Snowflake default for this value.

    Supporting Types

    BackupPolicyDescribeOutput, BackupPolicyDescribeOutputArgs

    comment String
    createdOn String
    databaseName String
    expireAfterDays Integer
    hasRetentionLock Boolean
    name String
    owner String
    ownerRoleType String
    schedule String
    schemaName String
    comment string
    createdOn string
    databaseName string
    expireAfterDays number
    hasRetentionLock boolean
    name string
    owner string
    ownerRoleType string
    schedule string
    schemaName string
    comment String
    createdOn String
    databaseName String
    expireAfterDays Number
    hasRetentionLock Boolean
    name String
    owner String
    ownerRoleType String
    schedule String
    schemaName String

    BackupPolicySchedule, BackupPolicyScheduleArgs

    Hours int
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    Minutes int
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    UsingCron string
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    Hours int
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    Minutes int
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    UsingCron string
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    hours number
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    minutes number
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    using_cron string
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    hours Integer
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    minutes Integer
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    usingCron String
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    hours number
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    minutes number
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    usingCron string
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    hours int
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    minutes int
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    using_cron str
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)
    hours Number
    Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with minutes and usingCron)
    minutes Number
    Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with hours and usingCron)
    usingCron String
    Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with hours and minutes)

    BackupPolicyShowOutput, BackupPolicyShowOutputArgs

    comment String
    createdOn String
    databaseName String
    expireAfterDays Integer
    hasRetentionLock Boolean
    name String
    owner String
    ownerRoleType String
    schedule String
    schemaName String
    comment string
    createdOn string
    databaseName string
    expireAfterDays number
    hasRetentionLock boolean
    name string
    owner string
    ownerRoleType string
    schedule string
    schemaName string
    comment String
    createdOn String
    databaseName String
    expireAfterDays Number
    hasRetentionLock Boolean
    name String
    owner String
    ownerRoleType String
    schedule String
    schemaName String

    Import

    $ pulumi import snowflake:index/backupPolicy:BackupPolicy example '"<database_name>"."<schema_name>"."<backup_policy_name>"'
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Viewing docs for Snowflake v2.23.0
    published on Friday, Nov 6, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial