com.pulumi.alicloud.nas.LifecyclePolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.nas;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.nas.LifecyclePolicyArgs;
import com.pulumi.alicloud.nas.inputs.LifecyclePolicyState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;
/**
* 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](https://www.alibabacloud.com/help/en/doc-detail/169362.html).
*
* > **NOTE:** Available in v1.153.0+.
*
* ## Example Usage
*
* Basic Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Network Attached Storage (NAS) Lifecycle Policy can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:nas/lifecyclePolicy:LifecyclePolicy example <file_system_id>:<lifecycle_policy_name>
* ```
*
*/
@ResourceType(type="alicloud:nas/lifecyclePolicy:LifecyclePolicy")
public class LifecyclePolicy extends com.pulumi.resources.CustomResource {
/**
* The ID of the file system.
*
*/
@Export(name="fileSystemId", refs={String.class}, tree="[0]")
private Output fileSystemId;
/**
* @return The ID of the file system.
*
*/
public Output fileSystemId() {
return this.fileSystemId;
}
/**
* The name of the lifecycle management policy.
*
*/
@Export(name="lifecyclePolicyName", refs={String.class}, tree="[0]")
private Output lifecyclePolicyName;
/**
* @return The name of the lifecycle management policy.
*
*/
public Output lifecyclePolicyName() {
return this.lifecyclePolicyName;
}
/**
* The rules in the lifecycle management policy. Valid values: `DEFAULT_ATIME_14`, `DEFAULT_ATIME_30`, `DEFAULT_ATIME_60`, `DEFAULT_ATIME_90`.
*
*/
@Export(name="lifecycleRuleName", refs={String.class}, tree="[0]")
private Output lifecycleRuleName;
/**
* @return The rules in the lifecycle management policy. Valid values: `DEFAULT_ATIME_14`, `DEFAULT_ATIME_30`, `DEFAULT_ATIME_60`, `DEFAULT_ATIME_90`.
*
*/
public Output lifecycleRuleName() {
return this.lifecycleRuleName;
}
/**
* 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.
*
*/
@Export(name="paths", refs={List.class,String.class}, tree="[0,1]")
private Output> paths;
/**
* @return 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.
*
*/
public Output> paths() {
return this.paths;
}
/**
* The storage type of the data that is dumped to the IA storage medium. Valid values: `InfrequentAccess`.
*
*/
@Export(name="storageType", refs={String.class}, tree="[0]")
private Output storageType;
/**
* @return The storage type of the data that is dumped to the IA storage medium. Valid values: `InfrequentAccess`.
*
*/
public Output storageType() {
return this.storageType;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public LifecyclePolicy(java.lang.String name) {
this(name, LifecyclePolicyArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public LifecyclePolicy(java.lang.String name, LifecyclePolicyArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public LifecyclePolicy(java.lang.String name, LifecyclePolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:nas/lifecyclePolicy:LifecyclePolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private LifecyclePolicy(java.lang.String name, Output id, @Nullable LifecyclePolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:nas/lifecyclePolicy:LifecyclePolicy", name, state, makeResourceOptions(options, id), false);
}
private static LifecyclePolicyArgs makeArgs(LifecyclePolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? LifecyclePolicyArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static LifecyclePolicy get(java.lang.String name, Output id, @Nullable LifecyclePolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new LifecyclePolicy(name, id, state, options);
}
}