published on Friday, Nov 6, 2026 by Pulumi
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
previewFeaturesEnabledfield 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.
- Expire
After intDays - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - With
Retention stringLock - (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 intDays - 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
Backup
Policy Schedule Args - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - With
Retention stringLock - (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_ numberdays - 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 (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - with_
retention_ stringlock - (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 IntegerDays - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - with
Retention StringLock - (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 numberDays - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - with
Retention stringLock - (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_ intdays - 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
Backup
Policy Schedule Args - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - with_
retention_ strlock - (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 NumberDays - 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 (
hoursorminutes) or a cron expression (usingCron). Exactly one of the sub-fields has to be set. - with
Retention StringLock - (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:
- Describe
Outputs List<BackupPolicy Describe Output> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - Fully
Qualified stringName - 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<BackupPolicy Show Output> - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy.
- Describe
Outputs []BackupPolicy Describe Output - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - Fully
Qualified stringName - 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 []BackupPolicy Show Output - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy.
- describe_
outputs list(object) - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - fully_
qualified_ stringname - 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 POLICIESfor the given backup policy.
- describe
Outputs List<BackupPolicy Describe Output> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - fully
Qualified StringName - 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<BackupPolicy Show Output> - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy.
- describe
Outputs BackupPolicy Describe Output[] - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - fully
Qualified stringName - 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 BackupPolicy Show Output[] - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy.
- describe_
outputs Sequence[BackupPolicy Describe Output] - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - fully_
qualified_ strname - 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[BackupPolicy Show Output] - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy.
- describe
Outputs List<Property Map> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - fully
Qualified StringName - 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<Property Map> - Outputs the result of
SHOW BACKUP POLICIESfor 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) -> BackupPolicyfunc 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.
- 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<BackupPolicy Describe Output> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - Expire
After intDays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- Fully
Qualified stringName - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) 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<BackupPolicy Show Output> - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - With
Retention stringLock - (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 []BackupPolicy Describe Output Args - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - Expire
After intDays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- Fully
Qualified stringName - 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
Backup
Policy Schedule Args - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) 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 []BackupPolicy Show Output Args - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - With
Retention stringLock - (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 POLICYfor the given backup policy. - expire_
after_ numberdays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- fully_
qualified_ stringname - 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 (
hoursorminutes) 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 POLICIESfor the given backup policy. - with_
retention_ stringlock - (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<BackupPolicy Describe Output> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - expire
After IntegerDays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- fully
Qualified StringName - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) 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<BackupPolicy Show Output> - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - with
Retention StringLock - (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 BackupPolicy Describe Output[] - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - expire
After numberDays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- fully
Qualified stringName - 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
Backup
Policy Schedule - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) 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 BackupPolicy Show Output[] - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - with
Retention stringLock - (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[BackupPolicy Describe Output Args] - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - expire_
after_ intdays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- fully_
qualified_ strname - 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
Backup
Policy Schedule Args - Specifies how often Snowflake creates a backup. Either an interval of at least 60 minutes (
hoursorminutes) 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[BackupPolicy Show Output Args] - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - with_
retention_ strlock - (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<Property Map> - Outputs the result of
DESCRIBE BACKUP POLICYfor the given backup policy. - expire
After NumberDays - Specifies the number of days until a backup expires. The minimum is 1. The maximum is 3653 when SCHEDULE is omitted.
- fully
Qualified StringName - 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 (
hoursorminutes) 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<Property Map> - Outputs the result of
SHOW BACKUP POLICIESfor the given backup policy. - with
Retention StringLock - (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
- Created
On string - Database
Name string - Expire
After intDays - Has
Retention boolLock - Name string
- Owner string
- Owner
Role stringType - Schedule string
- Schema
Name string
- Comment string
- Created
On string - Database
Name string - Expire
After intDays - Has
Retention boolLock - Name string
- Owner string
- Owner
Role stringType - Schedule string
- Schema
Name string
- comment string
- created_
on string - database_
name string - expire_
after_ numberdays - has_
retention_ boollock - name string
- owner string
- owner_
role_ stringtype - schedule string
- schema_
name string
- comment String
- created
On String - database
Name String - expire
After IntegerDays - has
Retention BooleanLock - name String
- owner String
- owner
Role StringType - schedule String
- schema
Name String
- comment string
- created
On string - database
Name string - expire
After numberDays - has
Retention booleanLock - name string
- owner string
- owner
Role stringType - schedule string
- schema
Name string
- comment str
- created_
on str - database_
name str - expire_
after_ intdays - has_
retention_ boollock - name str
- owner str
- owner_
role_ strtype - schedule str
- schema_
name str
- comment String
- created
On String - database
Name String - expire
After NumberDays - has
Retention BooleanLock - name String
- owner String
- owner
Role StringType - schedule String
- schema
Name String
BackupPolicySchedule, BackupPolicyScheduleArgs
- Hours int
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - Minutes int
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - Using
Cron string - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- Hours int
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - Minutes int
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - Using
Cron string - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- hours number
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - minutes number
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - using_
cron string - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- hours Integer
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - minutes Integer
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - using
Cron String - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- hours number
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - minutes number
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - using
Cron string - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- hours int
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - minutes int
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - using_
cron str - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
- hours Number
- Specifies an interval (in hours) of wait time inserted between backups. Accepts positive integers. (conflicts with
minutesandusingCron) - minutes Number
- Specifies an interval (in minutes) of wait time inserted between backups. Accepts integers of at least 60. (conflicts with
hoursandusingCron) - using
Cron String - Specifies a cron expression and time zone for creating backups. Supports a subset of standard cron utility syntax. (conflicts with
hoursandminutes)
BackupPolicyShowOutput, BackupPolicyShowOutputArgs
- Comment string
- Created
On string - Database
Name string - Expire
After intDays - Has
Retention boolLock - Name string
- Owner string
- Owner
Role stringType - Schedule string
- Schema
Name string
- Comment string
- Created
On string - Database
Name string - Expire
After intDays - Has
Retention boolLock - Name string
- Owner string
- Owner
Role stringType - Schedule string
- Schema
Name string
- comment string
- created_
on string - database_
name string - expire_
after_ numberdays - has_
retention_ boollock - name string
- owner string
- owner_
role_ stringtype - schedule string
- schema_
name string
- comment String
- created
On String - database
Name String - expire
After IntegerDays - has
Retention BooleanLock - name String
- owner String
- owner
Role StringType - schedule String
- schema
Name String
- comment string
- created
On string - database
Name string - expire
After numberDays - has
Retention booleanLock - name string
- owner string
- owner
Role stringType - schedule string
- schema
Name string
- comment str
- created_
on str - database_
name str - expire_
after_ intdays - has_
retention_ boollock - name str
- owner str
- owner_
role_ strtype - schedule str
- schema_
name str
- comment String
- created
On String - database
Name String - expire
After NumberDays - has
Retention BooleanLock - name String
- owner String
- owner
Role StringType - schedule String
- schema
Name 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
snowflakeTerraform Provider.
published on Friday, Nov 6, 2026 by Pulumi