alicloud.nas.AutoSnapshotPolicy
Explore with Pulumi AI
Provides a Network Attached Storage (NAS) Auto Snapshot Policy resource.
For information about Network Attached Storage (NAS) Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy.
NOTE: Available in v1.153.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = new AliCloud.Nas.AutoSnapshotPolicy("example", new()
{
AutoSnapshotPolicyName = "example_value",
RepeatWeekdays = new[]
{
"3",
"4",
"5",
},
RetentionDays = 30,
TimePoints = new[]
{
"3",
"4",
"5",
},
});
});
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 {
_, err := nas.NewAutoSnapshotPolicy(ctx, "example", &nas.AutoSnapshotPolicyArgs{
AutoSnapshotPolicyName: pulumi.String("example_value"),
RepeatWeekdays: pulumi.StringArray{
pulumi.String("3"),
pulumi.String("4"),
pulumi.String("5"),
},
RetentionDays: pulumi.Int(30),
TimePoints: pulumi.StringArray{
pulumi.String("3"),
pulumi.String("4"),
pulumi.String("5"),
},
})
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.AutoSnapshotPolicy;
import com.pulumi.alicloud.nas.AutoSnapshotPolicyArgs;
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 AutoSnapshotPolicy("example", AutoSnapshotPolicyArgs.builder()
.autoSnapshotPolicyName("example_value")
.repeatWeekdays(
"3",
"4",
"5")
.retentionDays(30)
.timePoints(
"3",
"4",
"5")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.nas.AutoSnapshotPolicy("example",
auto_snapshot_policy_name="example_value",
repeat_weekdays=[
"3",
"4",
"5",
],
retention_days=30,
time_points=[
"3",
"4",
"5",
])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.nas.AutoSnapshotPolicy("example", {
autoSnapshotPolicyName: "example_value",
repeatWeekdays: [
"3",
"4",
"5",
],
retentionDays: 30,
timePoints: [
"3",
"4",
"5",
],
});
resources:
example:
type: alicloud:nas:AutoSnapshotPolicy
properties:
autoSnapshotPolicyName: example_value
repeatWeekdays:
- '3'
- '4'
- '5'
retentionDays: 30
timePoints:
- '3'
- '4'
- '5'
Create AutoSnapshotPolicy Resource
new AutoSnapshotPolicy(name: string, args: AutoSnapshotPolicyArgs, opts?: CustomResourceOptions);
@overload
def AutoSnapshotPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
auto_snapshot_policy_name: Optional[str] = None,
repeat_weekdays: Optional[Sequence[str]] = None,
retention_days: Optional[int] = None,
time_points: Optional[Sequence[str]] = None)
@overload
def AutoSnapshotPolicy(resource_name: str,
args: AutoSnapshotPolicyArgs,
opts: Optional[ResourceOptions] = None)
func NewAutoSnapshotPolicy(ctx *Context, name string, args AutoSnapshotPolicyArgs, opts ...ResourceOption) (*AutoSnapshotPolicy, error)
public AutoSnapshotPolicy(string name, AutoSnapshotPolicyArgs args, CustomResourceOptions? opts = null)
public AutoSnapshotPolicy(String name, AutoSnapshotPolicyArgs args)
public AutoSnapshotPolicy(String name, AutoSnapshotPolicyArgs args, CustomResourceOptions options)
type: alicloud:nas:AutoSnapshotPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AutoSnapshotPolicyArgs
- 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 AutoSnapshotPolicyArgs
- 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 AutoSnapshotPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AutoSnapshotPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AutoSnapshotPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AutoSnapshotPolicy 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 AutoSnapshotPolicy resource accepts the following input properties:
- Repeat
Weekdays List<string> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- Time
Points List<string> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- Auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- Retention
Days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- Repeat
Weekdays []string The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- Time
Points []string The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- Auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- Retention
Days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- repeat
Weekdays List<String> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- time
Points List<String> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot StringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- retention
Days Integer The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- repeat
Weekdays string[] The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- time
Points string[] The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- retention
Days number The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- repeat_
weekdays Sequence[str] The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- time_
points Sequence[str] The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto_
snapshot_ strpolicy_ name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- retention_
days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- repeat
Weekdays List<String> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- time
Points List<String> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot StringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- retention
Days Number The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
Outputs
All input properties are implicitly available as output properties. Additionally, the AutoSnapshotPolicy resource produces the following output properties:
Look up Existing AutoSnapshotPolicy Resource
Get an existing AutoSnapshotPolicy 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?: AutoSnapshotPolicyState, opts?: CustomResourceOptions): AutoSnapshotPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_snapshot_policy_name: Optional[str] = None,
repeat_weekdays: Optional[Sequence[str]] = None,
retention_days: Optional[int] = None,
status: Optional[str] = None,
time_points: Optional[Sequence[str]] = None) -> AutoSnapshotPolicy
func GetAutoSnapshotPolicy(ctx *Context, name string, id IDInput, state *AutoSnapshotPolicyState, opts ...ResourceOption) (*AutoSnapshotPolicy, error)
public static AutoSnapshotPolicy Get(string name, Input<string> id, AutoSnapshotPolicyState? state, CustomResourceOptions? opts = null)
public static AutoSnapshotPolicy get(String name, Output<String> id, AutoSnapshotPolicyState 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.
- Auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- Repeat
Weekdays List<string> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- Retention
Days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- Status string
The status of the automatic snapshot policy.
- Time
Points List<string> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- Auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- Repeat
Weekdays []string The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- Retention
Days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- Status string
The status of the automatic snapshot policy.
- Time
Points []string The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot StringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- repeat
Weekdays List<String> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- retention
Days Integer The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- status String
The status of the automatic snapshot policy.
- time
Points List<String> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot stringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- repeat
Weekdays string[] The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- retention
Days number The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- status string
The status of the automatic snapshot policy.
- time
Points string[] The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto_
snapshot_ strpolicy_ name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- repeat_
weekdays Sequence[str] The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- retention_
days int The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- status str
The status of the automatic snapshot policy.
- time_
points Sequence[str] The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
- auto
Snapshot StringPolicy Name The name of the automatic snapshot policy. Limits:
- The name must be
2
to128
characters in length, - The name must start with a letter.
- The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with
http://
orhttps://
. - The value of this parameter is empty by default.
- The name must be
- repeat
Weekdays List<String> The day on which an auto snapshot is created.
- A maximum of 7 time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
- retention
Days Number The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
-1
: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
- status String
The status of the automatic snapshot policy.
- time
Points List<String> The point in time at which an auto snapshot is created.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
Import
Network Attached Storage (NAS) Auto Snapshot Policy can be imported using the id, e.g.
$ pulumi import alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.