alicloud.nas.LifecyclePolicy
Explore with Pulumi AI
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 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
The LifecyclePolicy resource accepts the following input properties:
- File
System stringId - The ID of the file system.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - 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. - Storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- File
System stringId - The ID of the file system.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - 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. - Storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file
System StringId - The ID of the file system.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - 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. - storage
Type String - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file
System stringId - The ID of the file system.
- lifecycle
Policy stringName - The name of the lifecycle management policy.
- lifecycle
Rule stringName - 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. - storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file_
system_ strid - The ID of the file system.
- lifecycle_
policy_ strname - The name of the lifecycle management policy.
- lifecycle_
rule_ strname - 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
.
- file
System StringId - The ID of the file system.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - 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. - storage
Type 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.
- File
System stringId - The ID of the file system.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - 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. - Storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- File
System stringId - The ID of the file system.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - 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. - Storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file
System StringId - The ID of the file system.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - 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. - storage
Type String - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file
System stringId - The ID of the file system.
- lifecycle
Policy stringName - The name of the lifecycle management policy.
- lifecycle
Rule stringName - 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. - storage
Type string - The storage type of the data that is dumped to the IA storage medium. Valid values:
InfrequentAccess
.
- file_
system_ strid - The ID of the file system.
- lifecycle_
policy_ strname - The name of the lifecycle management policy.
- lifecycle_
rule_ strname - 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
.
- file
System StringId - The ID of the file system.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - 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. - storage
Type 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>
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.