1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. nas
  5. LifecyclePolicy
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.nas.LifecyclePolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a Network Attached Storage (NAS) Lifecycle Policy resource.

    For information about Network Attached 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 exampleFileSystem = new alicloud.nas.FileSystem("exampleFileSystem", {
        protocolType: "NFS",
        storageType: "Capacity",
    });
    const exampleLifecyclePolicy = new alicloud.nas.LifecyclePolicy("exampleLifecyclePolicy", {
        fileSystemId: exampleFileSystem.id,
        lifecyclePolicyName: "terraform-example",
        lifecycleRuleName: "DEFAULT_ATIME_14",
        storageType: "InfrequentAccess",
        paths: ["/"],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_file_system = alicloud.nas.FileSystem("exampleFileSystem",
        protocol_type="NFS",
        storage_type="Capacity")
    example_lifecycle_policy = alicloud.nas.LifecyclePolicy("exampleLifecyclePolicy",
        file_system_id=example_file_system.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 {
    		exampleFileSystem, err := nas.NewFileSystem(ctx, "exampleFileSystem", &nas.FileSystemArgs{
    			ProtocolType: pulumi.String("NFS"),
    			StorageType:  pulumi.String("Capacity"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = nas.NewLifecyclePolicy(ctx, "exampleLifecyclePolicy", &nas.LifecyclePolicyArgs{
    			FileSystemId:        exampleFileSystem.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 exampleFileSystem = new AliCloud.Nas.FileSystem("exampleFileSystem", new()
        {
            ProtocolType = "NFS",
            StorageType = "Capacity",
        });
    
        var exampleLifecyclePolicy = new AliCloud.Nas.LifecyclePolicy("exampleLifecyclePolicy", new()
        {
            FileSystemId = exampleFileSystem.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 exampleFileSystem = new FileSystem("exampleFileSystem", FileSystemArgs.builder()        
                .protocolType("NFS")
                .storageType("Capacity")
                .build());
    
            var exampleLifecyclePolicy = new LifecyclePolicy("exampleLifecyclePolicy", LifecyclePolicyArgs.builder()        
                .fileSystemId(exampleFileSystem.id())
                .lifecyclePolicyName("terraform-example")
                .lifecycleRuleName("DEFAULT_ATIME_14")
                .storageType("InfrequentAccess")
                .paths("/")
                .build());
    
        }
    }
    
    resources:
      exampleFileSystem:
        type: alicloud:nas:FileSystem
        properties:
          protocolType: NFS
          storageType: Capacity
      exampleLifecyclePolicy:
        type: alicloud:nas:LifecyclePolicy
        properties:
          fileSystemId: ${exampleFileSystem.id}
          lifecyclePolicyName: terraform-example
          lifecycleRuleName: DEFAULT_ATIME_14
          storageType: InfrequentAccess
          paths:
            - /
    

    Create LifecyclePolicy Resource

    new LifecyclePolicy(name: string, args: LifecyclePolicyArgs, opts?: CustomResourceOptions);
    @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)
    @overload
    def LifecyclePolicy(resource_name: str,
                        args: LifecyclePolicyArgs,
                        opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    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

    Network Attached 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>
    

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi