1. Packages
  2. Packages
  3. Snowflake Provider
  4. API Docs
  5. StorageLifecyclePolicy
Viewing docs for Snowflake v2.18.0
published on Wednesday, Jul 8, 2026 by Pulumi
snowflake logo
Viewing docs for Snowflake v2.18.0
published on Wednesday, Jul 8, 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 storage lifecycle policy objects. For more information, check storage lifecycle 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
    const basic = new snowflake.StorageLifecyclePolicy("basic", {
        database: "database_name",
        schema: "schema_name",
        name: "storage_lifecycle_policy_name",
        arguments: [{
            name: "VAL",
            type: "VARCHAR",
        }],
        body: "LENGTH(VAL) > 0",
    });
    //# Complete
    const complete = new snowflake.StorageLifecyclePolicy("complete", {
        database: "database_name",
        schema: "schema_name",
        name: "storage_lifecycle_policy_name",
        arguments: [
            {
                name: "VAL",
                type: "VARCHAR",
            },
            {
                name: "CREATED_AT",
                type: "TIMESTAMP_NTZ",
            },
        ],
        body: "LENGTH(VAL) > 0",
        archiveTier: "COLD",
        archiveForDays: 365,
        comment: "My storage lifecycle policy",
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    ## Minimal
    basic = snowflake.StorageLifecyclePolicy("basic",
        database="database_name",
        schema="schema_name",
        name="storage_lifecycle_policy_name",
        arguments=[{
            "name": "VAL",
            "type": "VARCHAR",
        }],
        body="LENGTH(VAL) > 0")
    ## Complete
    complete = snowflake.StorageLifecyclePolicy("complete",
        database="database_name",
        schema="schema_name",
        name="storage_lifecycle_policy_name",
        arguments=[
            {
                "name": "VAL",
                "type": "VARCHAR",
            },
            {
                "name": "CREATED_AT",
                "type": "TIMESTAMP_NTZ",
            },
        ],
        body="LENGTH(VAL) > 0",
        archive_tier="COLD",
        archive_for_days=365,
        comment="My storage lifecycle policy")
    
    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
    		_, err := snowflake.NewStorageLifecyclePolicy(ctx, "basic", &snowflake.StorageLifecyclePolicyArgs{
    			Database: pulumi.String("database_name"),
    			Schema:   pulumi.String("schema_name"),
    			Name:     pulumi.String("storage_lifecycle_policy_name"),
    			Arguments: snowflake.StorageLifecyclePolicyArgumentArray{
    				&snowflake.StorageLifecyclePolicyArgumentArgs{
    					Name: pulumi.String("VAL"),
    					Type: pulumi.String("VARCHAR"),
    				},
    			},
    			Body: pulumi.String("LENGTH(VAL) > 0"),
    		})
    		if err != nil {
    			return err
    		}
    		// # Complete
    		_, err = snowflake.NewStorageLifecyclePolicy(ctx, "complete", &snowflake.StorageLifecyclePolicyArgs{
    			Database: pulumi.String("database_name"),
    			Schema:   pulumi.String("schema_name"),
    			Name:     pulumi.String("storage_lifecycle_policy_name"),
    			Arguments: snowflake.StorageLifecyclePolicyArgumentArray{
    				&snowflake.StorageLifecyclePolicyArgumentArgs{
    					Name: pulumi.String("VAL"),
    					Type: pulumi.String("VARCHAR"),
    				},
    				&snowflake.StorageLifecyclePolicyArgumentArgs{
    					Name: pulumi.String("CREATED_AT"),
    					Type: pulumi.String("TIMESTAMP_NTZ"),
    				},
    			},
    			Body:           pulumi.String("LENGTH(VAL) > 0"),
    			ArchiveTier:    pulumi.String("COLD"),
    			ArchiveForDays: pulumi.Int(365),
    			Comment:        pulumi.String("My storage lifecycle policy"),
    		})
    		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
        var basic = new Snowflake.StorageLifecyclePolicy("basic", new()
        {
            Database = "database_name",
            Schema = "schema_name",
            Name = "storage_lifecycle_policy_name",
            Arguments = new[]
            {
                new Snowflake.Inputs.StorageLifecyclePolicyArgumentArgs
                {
                    Name = "VAL",
                    Type = "VARCHAR",
                },
            },
            Body = "LENGTH(VAL) > 0",
        });
    
        //# Complete
        var complete = new Snowflake.StorageLifecyclePolicy("complete", new()
        {
            Database = "database_name",
            Schema = "schema_name",
            Name = "storage_lifecycle_policy_name",
            Arguments = new[]
            {
                new Snowflake.Inputs.StorageLifecyclePolicyArgumentArgs
                {
                    Name = "VAL",
                    Type = "VARCHAR",
                },
                new Snowflake.Inputs.StorageLifecyclePolicyArgumentArgs
                {
                    Name = "CREATED_AT",
                    Type = "TIMESTAMP_NTZ",
                },
            },
            Body = "LENGTH(VAL) > 0",
            ArchiveTier = "COLD",
            ArchiveForDays = 365,
            Comment = "My storage lifecycle policy",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.StorageLifecyclePolicy;
    import com.pulumi.snowflake.StorageLifecyclePolicyArgs;
    import com.pulumi.snowflake.inputs.StorageLifecyclePolicyArgumentArgs;
    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
            var basic = new StorageLifecyclePolicy("basic", StorageLifecyclePolicyArgs.builder()
                .database("database_name")
                .schema("schema_name")
                .name("storage_lifecycle_policy_name")
                .arguments(StorageLifecyclePolicyArgumentArgs.builder()
                    .name("VAL")
                    .type("VARCHAR")
                    .build())
                .body("LENGTH(VAL) > 0")
                .build());
    
            //# Complete
            var complete = new StorageLifecyclePolicy("complete", StorageLifecyclePolicyArgs.builder()
                .database("database_name")
                .schema("schema_name")
                .name("storage_lifecycle_policy_name")
                .arguments(            
                    StorageLifecyclePolicyArgumentArgs.builder()
                        .name("VAL")
                        .type("VARCHAR")
                        .build(),
                    StorageLifecyclePolicyArgumentArgs.builder()
                        .name("CREATED_AT")
                        .type("TIMESTAMP_NTZ")
                        .build())
                .body("LENGTH(VAL) > 0")
                .archiveTier("COLD")
                .archiveForDays(365)
                .comment("My storage lifecycle policy")
                .build());
    
        }
    }
    
    resources:
      ## Minimal
      basic:
        type: snowflake:StorageLifecyclePolicy
        properties:
          database: database_name
          schema: schema_name
          name: storage_lifecycle_policy_name
          arguments:
            - name: VAL
              type: VARCHAR
          body: LENGTH(VAL) > 0
      ## Complete
      complete:
        type: snowflake:StorageLifecyclePolicy
        properties:
          database: database_name
          schema: schema_name
          name: storage_lifecycle_policy_name
          arguments:
            - name: VAL
              type: VARCHAR
            - name: CREATED_AT
              type: TIMESTAMP_NTZ
          body: LENGTH(VAL) > 0
          archiveTier: COLD
          archiveForDays: 365
          comment: My storage lifecycle policy
    
    pulumi {
      required_providers {
        snowflake = {
          source = "pulumi/snowflake"
        }
      }
    }
    
    ## Minimal
    resource "snowflake_storagelifecyclepolicy" "basic" {
      database = "database_name"
      schema   = "schema_name"
      name     = "storage_lifecycle_policy_name"
      arguments {
        name = "VAL"
        type = "VARCHAR"
      }
      body = "LENGTH(VAL) > 0"
    }
    ## Complete
    resource "snowflake_storagelifecyclepolicy" "complete" {
      database = "database_name"
      schema   = "schema_name"
      name     = "storage_lifecycle_policy_name"
      arguments {
        name = "VAL"
        type = "VARCHAR"
      }
      arguments {
        name = "CREATED_AT"
        type = "TIMESTAMP_NTZ"
      }
      body             = "LENGTH(VAL) > 0"
      archive_tier     = "COLD"
      archive_for_days = 365
      comment          = "My storage lifecycle policy"
    }
    

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

    Create StorageLifecyclePolicy Resource

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

    Constructor syntax

    new StorageLifecyclePolicy(name: string, args: StorageLifecyclePolicyArgs, opts?: CustomResourceOptions);
    @overload
    def StorageLifecyclePolicy(resource_name: str,
                               args: StorageLifecyclePolicyArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def StorageLifecyclePolicy(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               arguments: Optional[Sequence[StorageLifecyclePolicyArgumentArgs]] = None,
                               body: Optional[str] = None,
                               database: Optional[str] = None,
                               schema: Optional[str] = None,
                               archive_for_days: Optional[int] = None,
                               archive_tier: Optional[str] = None,
                               comment: Optional[str] = None,
                               name: Optional[str] = None)
    func NewStorageLifecyclePolicy(ctx *Context, name string, args StorageLifecyclePolicyArgs, opts ...ResourceOption) (*StorageLifecyclePolicy, error)
    public StorageLifecyclePolicy(string name, StorageLifecyclePolicyArgs args, CustomResourceOptions? opts = null)
    public StorageLifecyclePolicy(String name, StorageLifecyclePolicyArgs args)
    public StorageLifecyclePolicy(String name, StorageLifecyclePolicyArgs args, CustomResourceOptions options)
    
    type: snowflake:StorageLifecyclePolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "snowflake_storagelifecyclepolicy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args StorageLifecyclePolicyArgs
    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 StorageLifecyclePolicyArgs
    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 StorageLifecyclePolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StorageLifecyclePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args StorageLifecyclePolicyArgs
    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 storageLifecyclePolicyResource = new Snowflake.StorageLifecyclePolicy("storageLifecyclePolicyResource", new()
    {
        Arguments = new[]
        {
            new Snowflake.Inputs.StorageLifecyclePolicyArgumentArgs
            {
                Name = "string",
                Type = "string",
            },
        },
        Body = "string",
        Database = "string",
        Schema = "string",
        ArchiveForDays = 0,
        ArchiveTier = "string",
        Comment = "string",
        Name = "string",
    });
    
    example, err := snowflake.NewStorageLifecyclePolicy(ctx, "storageLifecyclePolicyResource", &snowflake.StorageLifecyclePolicyArgs{
    	Arguments: snowflake.StorageLifecyclePolicyArgumentArray{
    		&snowflake.StorageLifecyclePolicyArgumentArgs{
    			Name: pulumi.String("string"),
    			Type: pulumi.String("string"),
    		},
    	},
    	Body:           pulumi.String("string"),
    	Database:       pulumi.String("string"),
    	Schema:         pulumi.String("string"),
    	ArchiveForDays: pulumi.Int(0),
    	ArchiveTier:    pulumi.String("string"),
    	Comment:        pulumi.String("string"),
    	Name:           pulumi.String("string"),
    })
    
    resource "snowflake_storagelifecyclepolicy" "storageLifecyclePolicyResource" {
      arguments {
        name = "string"
        type = "string"
      }
      body             = "string"
      database         = "string"
      schema           = "string"
      archive_for_days = 0
      archive_tier     = "string"
      comment          = "string"
      name             = "string"
    }
    
    var storageLifecyclePolicyResource = new StorageLifecyclePolicy("storageLifecyclePolicyResource", StorageLifecyclePolicyArgs.builder()
        .arguments(StorageLifecyclePolicyArgumentArgs.builder()
            .name("string")
            .type("string")
            .build())
        .body("string")
        .database("string")
        .schema("string")
        .archiveForDays(0)
        .archiveTier("string")
        .comment("string")
        .name("string")
        .build());
    
    storage_lifecycle_policy_resource = snowflake.StorageLifecyclePolicy("storageLifecyclePolicyResource",
        arguments=[{
            "name": "string",
            "type": "string",
        }],
        body="string",
        database="string",
        schema="string",
        archive_for_days=0,
        archive_tier="string",
        comment="string",
        name="string")
    
    const storageLifecyclePolicyResource = new snowflake.StorageLifecyclePolicy("storageLifecyclePolicyResource", {
        arguments: [{
            name: "string",
            type: "string",
        }],
        body: "string",
        database: "string",
        schema: "string",
        archiveForDays: 0,
        archiveTier: "string",
        comment: "string",
        name: "string",
    });
    
    type: snowflake:StorageLifecyclePolicy
    properties:
        archiveForDays: 0
        archiveTier: string
        arguments:
            - name: string
              type: string
        body: string
        comment: string
        database: string
        name: string
        schema: string
    

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

    Arguments List<StorageLifecyclePolicyArgument>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    Body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    Database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ArchiveForDays int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    ArchiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    Comment string
    Specifies a comment for the storage lifecycle policy.
    Name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Arguments []StorageLifecyclePolicyArgumentArgs
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    Body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    Database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ArchiveForDays int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    ArchiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    Comment string
    Specifies a comment for the storage lifecycle policy.
    Name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    arguments list(object)
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    archive_for_days number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archive_tier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    comment string
    Specifies a comment for the storage lifecycle policy.
    name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    arguments List<StorageLifecyclePolicyArgument>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body String
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    database String
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    archiveForDays Integer
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier String
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    comment String
    Specifies a comment for the storage lifecycle policy.
    name String
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    arguments StorageLifecyclePolicyArgument[]
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    archiveForDays number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    comment string
    Specifies a comment for the storage lifecycle policy.
    name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    arguments Sequence[StorageLifecyclePolicyArgumentArgs]
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body str
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    database str
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema str
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    archive_for_days int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archive_tier str
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    comment str
    Specifies a comment for the storage lifecycle policy.
    name str
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    arguments List<Property Map>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body String
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    database String
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    archiveForDays Number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier String
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    comment String
    Specifies a comment for the storage lifecycle policy.
    name String
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".

    Outputs

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

    DescribeOutputs List<StorageLifecyclePolicyDescribeOutput>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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<StorageLifecyclePolicyShowOutput>
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    DescribeOutputs []StorageLifecyclePolicyDescribeOutput
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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 []StorageLifecyclePolicyShowOutput
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    describe_outputs list(object)
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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 STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    describeOutputs List<StorageLifecyclePolicyDescribeOutput>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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<StorageLifecyclePolicyShowOutput>
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    describeOutputs StorageLifecyclePolicyDescribeOutput[]
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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 StorageLifecyclePolicyShowOutput[]
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    describe_outputs Sequence[StorageLifecyclePolicyDescribeOutput]
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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[StorageLifecyclePolicyShowOutput]
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    describeOutputs List<Property Map>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle 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 STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.

    Look up Existing StorageLifecyclePolicy Resource

    Get an existing StorageLifecyclePolicy 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?: StorageLifecyclePolicyState, opts?: CustomResourceOptions): StorageLifecyclePolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            archive_for_days: Optional[int] = None,
            archive_tier: Optional[str] = None,
            arguments: Optional[Sequence[StorageLifecyclePolicyArgumentArgs]] = None,
            body: Optional[str] = None,
            comment: Optional[str] = None,
            database: Optional[str] = None,
            describe_outputs: Optional[Sequence[StorageLifecyclePolicyDescribeOutputArgs]] = None,
            fully_qualified_name: Optional[str] = None,
            name: Optional[str] = None,
            schema: Optional[str] = None,
            show_outputs: Optional[Sequence[StorageLifecyclePolicyShowOutputArgs]] = None) -> StorageLifecyclePolicy
    func GetStorageLifecyclePolicy(ctx *Context, name string, id IDInput, state *StorageLifecyclePolicyState, opts ...ResourceOption) (*StorageLifecyclePolicy, error)
    public static StorageLifecyclePolicy Get(string name, Input<string> id, StorageLifecyclePolicyState? state, CustomResourceOptions? opts = null)
    public static StorageLifecyclePolicy get(String name, Output<String> id, StorageLifecyclePolicyState state, CustomResourceOptions options)
    resources:  _:    type: snowflake:StorageLifecyclePolicy    get:      id: ${id}
    import {
      to = snowflake_storagelifecyclepolicy.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:
    ArchiveForDays int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    ArchiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    Arguments List<StorageLifecyclePolicyArgument>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    Body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    Comment string
    Specifies a comment for the storage lifecycle policy.
    Database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    DescribeOutputs List<StorageLifecyclePolicyDescribeOutput>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs List<StorageLifecyclePolicyShowOutput>
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    ArchiveForDays int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    ArchiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    Arguments []StorageLifecyclePolicyArgumentArgs
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    Body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    Comment string
    Specifies a comment for the storage lifecycle policy.
    Database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    DescribeOutputs []StorageLifecyclePolicyDescribeOutputArgs
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs []StorageLifecyclePolicyShowOutputArgs
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    archive_for_days number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archive_tier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    arguments list(object)
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    comment string
    Specifies a comment for the storage lifecycle policy.
    database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describe_outputs list(object)
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    fully_qualified_name string
    Fully qualified name of the resource. For more information, see object name resolution.
    name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    show_outputs list(object)
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    archiveForDays Integer
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier String
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    arguments List<StorageLifecyclePolicyArgument>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body String
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    comment String
    Specifies a comment for the storage lifecycle policy.
    database String
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs List<StorageLifecyclePolicyDescribeOutput>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    name String
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<StorageLifecyclePolicyShowOutput>
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    archiveForDays number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier string
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    arguments StorageLifecyclePolicyArgument[]
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body string
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    comment string
    Specifies a comment for the storage lifecycle policy.
    database string
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs StorageLifecyclePolicyDescribeOutput[]
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    name string
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema string
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs StorageLifecyclePolicyShowOutput[]
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    archive_for_days int
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archive_tier str
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    arguments Sequence[StorageLifecyclePolicyArgumentArgs]
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body str
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    comment str
    Specifies a comment for the storage lifecycle policy.
    database str
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describe_outputs Sequence[StorageLifecyclePolicyDescribeOutputArgs]
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    name str
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema str
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    show_outputs Sequence[StorageLifecyclePolicyShowOutputArgs]
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.
    archiveForDays Number
    Specifies the number of days to keep rows that match the policy expression in archive storage. If set, Snowflake moves the data into archive storage according to the value you select for archive_tier. If unset, Snowflake expires the rows from the table without archiving the data.
    archiveTier String
    Specifies the type of storage tier to use for archiving rows. After you set the ARCHIVE_TIER for a policy, you can’t modify it. If you don’t specify this parameter, the policy is an expiration policy that deletes rows without archiving them. Valid values are (case-insensitive): COOL | COLD.
    arguments List<Property Map>
    List of the arguments for the storage lifecycle policy. A signature specifies a set of attributes that must be considered to determine whether the row is ready for expiration.
    body String
    Specifies the SQL expression. The expression can be any boolean-valued SQL expression. To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
    comment String
    Specifies a comment for the storage lifecycle policy.
    database String
    The database in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    describeOutputs List<Property Map>
    Outputs the result of DESCRIBE STORAGE LIFECYCLE POLICY for the given storage lifecycle policy.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    name String
    Specifies the identifier for the storage lifecycle policy; must be unique for the database and schema in which the storage lifecycle policy is created. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    schema String
    The schema in which to create the storage lifecycle policy. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<Property Map>
    Outputs the result of SHOW STORAGE LIFECYCLE POLICIES for the given storage lifecycle policy.

    Supporting Types

    StorageLifecyclePolicyArgument, StorageLifecyclePolicyArgumentArgs

    Name string
    The argument name.
    Type string
    The argument type. For more information about data types, check Snowflake docs.
    Name string
    The argument name.
    Type string
    The argument type. For more information about data types, check Snowflake docs.
    name string
    The argument name.
    type string
    The argument type. For more information about data types, check Snowflake docs.
    name String
    The argument name.
    type String
    The argument type. For more information about data types, check Snowflake docs.
    name string
    The argument name.
    type string
    The argument type. For more information about data types, check Snowflake docs.
    name str
    The argument name.
    type str
    The argument type. For more information about data types, check Snowflake docs.
    name String
    The argument name.
    type String
    The argument type. For more information about data types, check Snowflake docs.

    StorageLifecyclePolicyDescribeOutput, StorageLifecyclePolicyDescribeOutputArgs

    StorageLifecyclePolicyDescribeOutputSignature, StorageLifecyclePolicyDescribeOutputSignatureArgs

    Name string
    Type string
    Name string
    Type string
    name string
    type string
    name String
    type String
    name string
    type string
    name str
    type str
    name String
    type String

    StorageLifecyclePolicyShowOutput, StorageLifecyclePolicyShowOutputArgs

    Comment string
    CreatedOn string
    DatabaseName string
    Kind string
    Name string
    Options string
    Owner string
    OwnerRoleType string
    SchemaName string
    Comment string
    CreatedOn string
    DatabaseName string
    Kind string
    Name string
    Options string
    Owner string
    OwnerRoleType string
    SchemaName string
    comment string
    created_on string
    database_name string
    kind string
    name string
    options string
    owner string
    owner_role_type string
    schema_name string
    comment String
    createdOn String
    databaseName String
    kind String
    name String
    options String
    owner String
    ownerRoleType String
    schemaName String
    comment string
    createdOn string
    databaseName string
    kind string
    name string
    options string
    owner string
    ownerRoleType string
    schemaName string
    comment String
    createdOn String
    databaseName String
    kind String
    name String
    options String
    owner String
    ownerRoleType String
    schemaName String

    Import

    $ pulumi import snowflake:index/storageLifecyclePolicy:StorageLifecyclePolicy example '"<database_name>"."<schema_name>"."<storage_lifecycle_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.18.0
    published on Wednesday, Jul 8, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial