alicloud.nas.LifecyclePolicy
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
using System.Collections.Generic;
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 = "my-LifecyclePolicy",
LifecycleRuleName = "DEFAULT_ATIME_14",
StorageType = "InfrequentAccess",
});
});
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("my-LifecyclePolicy"),
LifecycleRuleName: pulumi.String("DEFAULT_ATIME_14"),
StorageType: pulumi.String("InfrequentAccess"),
})
if err != nil {
return err
}
return nil
})
}
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("my-LifecyclePolicy")
.lifecycleRuleName("DEFAULT_ATIME_14")
.storageType("InfrequentAccess")
.build());
}
}
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="my-LifecyclePolicy",
lifecycle_rule_name="DEFAULT_ATIME_14",
storage_type="InfrequentAccess")
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: "my-LifecyclePolicy",
lifecycleRuleName: "DEFAULT_ATIME_14",
storageType: "InfrequentAccess",
});
resources:
exampleFileSystem:
type: alicloud:nas:FileSystem
properties:
protocolType: NFS
storageType: Capacity
exampleLifecyclePolicy:
type: alicloud:nas:LifecyclePolicy
properties:
fileSystemId: ${exampleFileSystem.id}
lifecyclePolicyName: my-LifecyclePolicy
lifecycleRuleName: DEFAULT_ATIME_14
storageType: InfrequentAccess
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:
- 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>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.