1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nas
  5. LifecyclePolicy
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.nas.LifecyclePolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a File Storage (NAS) Lifecycle Policy resource.

    For information about File Storage (NAS) Lifecycle Policy and how to use it, see What is Lifecycle Policy.

    NOTE: Available in v1.153.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.nas.FileSystem("example", {
        protocolType: "NFS",
        storageType: "Capacity",
    });
    const exampleLifecyclePolicy = new alicloud.nas.LifecyclePolicy("example", {
        fileSystemId: example.id,
        lifecyclePolicyName: "terraform-example",
        lifecycleRuleName: "DEFAULT_ATIME_14",
        storageType: "InfrequentAccess",
        paths: ["/"],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.nas.FileSystem("example",
        protocol_type="NFS",
        storage_type="Capacity")
    example_lifecycle_policy = alicloud.nas.LifecyclePolicy("example",
        file_system_id=example.id,
        lifecycle_policy_name="terraform-example",
        lifecycle_rule_name="DEFAULT_ATIME_14",
        storage_type="InfrequentAccess",
        paths=["/"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := nas.NewFileSystem(ctx, "example", &nas.FileSystemArgs{
    			ProtocolType: pulumi.String("NFS"),
    			StorageType:  pulumi.String("Capacity"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = nas.NewLifecyclePolicy(ctx, "example", &nas.LifecyclePolicyArgs{
    			FileSystemId:        example.ID(),
    			LifecyclePolicyName: pulumi.String("terraform-example"),
    			LifecycleRuleName:   pulumi.String("DEFAULT_ATIME_14"),
    			StorageType:         pulumi.String("InfrequentAccess"),
    			Paths: pulumi.StringArray{
    				pulumi.String("/"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Nas.FileSystem("example", new()
        {
            ProtocolType = "NFS",
            StorageType = "Capacity",
        });
    
        var exampleLifecyclePolicy = new AliCloud.Nas.LifecyclePolicy("example", new()
        {
            FileSystemId = example.Id,
            LifecyclePolicyName = "terraform-example",
            LifecycleRuleName = "DEFAULT_ATIME_14",
            StorageType = "InfrequentAccess",
            Paths = new[]
            {
                "/",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.nas.FileSystem;
    import com.pulumi.alicloud.nas.FileSystemArgs;
    import com.pulumi.alicloud.nas.LifecyclePolicy;
    import com.pulumi.alicloud.nas.LifecyclePolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            var example = new FileSystem("example", FileSystemArgs.builder()
                .protocolType("NFS")
                .storageType("Capacity")
                .build());
    
            var exampleLifecyclePolicy = new LifecyclePolicy("exampleLifecyclePolicy", LifecyclePolicyArgs.builder()
                .fileSystemId(example.id())
                .lifecyclePolicyName("terraform-example")
                .lifecycleRuleName("DEFAULT_ATIME_14")
                .storageType("InfrequentAccess")
                .paths("/")
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:nas:FileSystem
        properties:
          protocolType: NFS
          storageType: Capacity
      exampleLifecyclePolicy:
        type: alicloud:nas:LifecyclePolicy
        name: example
        properties:
          fileSystemId: ${example.id}
          lifecyclePolicyName: terraform-example
          lifecycleRuleName: DEFAULT_ATIME_14
          storageType: InfrequentAccess
          paths:
            - /
    

    Create LifecyclePolicy Resource

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

    Constructor syntax

    new LifecyclePolicy(name: string, args: LifecyclePolicyArgs, opts?: CustomResourceOptions);
    @overload
    def LifecyclePolicy(resource_name: str,
                        args: LifecyclePolicyArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def LifecyclePolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        file_system_id: Optional[str] = None,
                        lifecycle_policy_name: Optional[str] = None,
                        lifecycle_rule_name: Optional[str] = None,
                        paths: Optional[Sequence[str]] = None,
                        storage_type: Optional[str] = None)
    func NewLifecyclePolicy(ctx *Context, name string, args LifecyclePolicyArgs, opts ...ResourceOption) (*LifecyclePolicy, error)
    public LifecyclePolicy(string name, LifecyclePolicyArgs args, CustomResourceOptions? opts = null)
    public LifecyclePolicy(String name, LifecyclePolicyArgs args)
    public LifecyclePolicy(String name, LifecyclePolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:nas:LifecyclePolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LifecyclePolicyArgs
    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 LifecyclePolicyArgs
    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 LifecyclePolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LifecyclePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LifecyclePolicyArgs
    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 lifecyclePolicyResource = new AliCloud.Nas.LifecyclePolicy("lifecyclePolicyResource", new()
    {
        FileSystemId = "string",
        LifecyclePolicyName = "string",
        LifecycleRuleName = "string",
        Paths = new[]
        {
            "string",
        },
        StorageType = "string",
    });
    
    example, err := nas.NewLifecyclePolicy(ctx, "lifecyclePolicyResource", &nas.LifecyclePolicyArgs{
    	FileSystemId:        pulumi.String("string"),
    	LifecyclePolicyName: pulumi.String("string"),
    	LifecycleRuleName:   pulumi.String("string"),
    	Paths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	StorageType: pulumi.String("string"),
    })
    
    var lifecyclePolicyResource = new LifecyclePolicy("lifecyclePolicyResource", LifecyclePolicyArgs.builder()
        .fileSystemId("string")
        .lifecyclePolicyName("string")
        .lifecycleRuleName("string")
        .paths("string")
        .storageType("string")
        .build());
    
    lifecycle_policy_resource = alicloud.nas.LifecyclePolicy("lifecyclePolicyResource",
        file_system_id="string",
        lifecycle_policy_name="string",
        lifecycle_rule_name="string",
        paths=["string"],
        storage_type="string")
    
    const lifecyclePolicyResource = new alicloud.nas.LifecyclePolicy("lifecyclePolicyResource", {
        fileSystemId: "string",
        lifecyclePolicyName: "string",
        lifecycleRuleName: "string",
        paths: ["string"],
        storageType: "string",
    });
    
    type: alicloud:nas:LifecyclePolicy
    properties:
        fileSystemId: string
        lifecyclePolicyName: string
        lifecycleRuleName: string
        paths:
            - string
        storageType: string
    

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

    FileSystemId string
    The ID of the file system.
    LifecyclePolicyName string
    The name of the lifecycle management policy.
    LifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    Paths List<string>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    StorageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    FileSystemId string
    The ID of the file system.
    LifecyclePolicyName string
    The name of the lifecycle management policy.
    LifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    Paths []string
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    StorageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId String
    The ID of the file system.
    lifecyclePolicyName String
    The name of the lifecycle management policy.
    lifecycleRuleName String
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths List<String>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType String
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId string
    The ID of the file system.
    lifecyclePolicyName string
    The name of the lifecycle management policy.
    lifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths string[]
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    file_system_id str
    The ID of the file system.
    lifecycle_policy_name str
    The name of the lifecycle management policy.
    lifecycle_rule_name str
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths Sequence[str]
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storage_type str
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId String
    The ID of the file system.
    lifecyclePolicyName String
    The name of the lifecycle management policy.
    lifecycleRuleName String
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths List<String>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType String
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing LifecyclePolicy Resource

    Get an existing LifecyclePolicy 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?: LifecyclePolicyState, opts?: CustomResourceOptions): LifecyclePolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            file_system_id: Optional[str] = None,
            lifecycle_policy_name: Optional[str] = None,
            lifecycle_rule_name: Optional[str] = None,
            paths: Optional[Sequence[str]] = None,
            storage_type: Optional[str] = None) -> LifecyclePolicy
    func GetLifecyclePolicy(ctx *Context, name string, id IDInput, state *LifecyclePolicyState, opts ...ResourceOption) (*LifecyclePolicy, error)
    public static LifecyclePolicy Get(string name, Input<string> id, LifecyclePolicyState? state, CustomResourceOptions? opts = null)
    public static LifecyclePolicy get(String name, Output<String> id, LifecyclePolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    FileSystemId string
    The ID of the file system.
    LifecyclePolicyName string
    The name of the lifecycle management policy.
    LifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    Paths List<string>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    StorageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    FileSystemId string
    The ID of the file system.
    LifecyclePolicyName string
    The name of the lifecycle management policy.
    LifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    Paths []string
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    StorageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId String
    The ID of the file system.
    lifecyclePolicyName String
    The name of the lifecycle management policy.
    lifecycleRuleName String
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths List<String>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType String
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId string
    The ID of the file system.
    lifecyclePolicyName string
    The name of the lifecycle management policy.
    lifecycleRuleName string
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths string[]
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType string
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    file_system_id str
    The ID of the file system.
    lifecycle_policy_name str
    The name of the lifecycle management policy.
    lifecycle_rule_name str
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths Sequence[str]
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storage_type str
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.
    fileSystemId String
    The ID of the file system.
    lifecyclePolicyName String
    The name of the lifecycle management policy.
    lifecycleRuleName String
    The rules in the lifecycle management policy. Valid values: DEFAULT_ATIME_14, DEFAULT_ATIME_30, DEFAULT_ATIME_60, DEFAULT_ATIME_90.
    paths List<String>
    The absolute path of the directory for which the lifecycle management policy is configured. Set a maximum of 10 path. The path value must be prefixed by a forward slash (/) and must be an existing path in the mount target.
    storageType String
    The storage type of the data that is dumped to the IA storage medium. Valid values: InfrequentAccess.

    Import

    File Storage (NAS) Lifecycle Policy can be imported using the id, e.g.

    $ pulumi import alicloud:nas/lifecyclePolicy:LifecyclePolicy example <file_system_id>:<lifecycle_policy_name>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi