Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

AutoSnapshotPolicy

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 Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.Nas.AutoSnapshotPolicy("example", new AliCloud.Nas.AutoSnapshotPolicyArgs
        {
            AutoSnapshotPolicyName = "example_value",
            RepeatWeekdays = 
            {
                "3",
                "4",
                "5",
            },
            RetentionDays = 30,
            TimePoints = 
            {
                "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:

RepeatWeekdays 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 (,).
TimePoints 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 (,).
AutoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
RetentionDays 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.
RepeatWeekdays []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 (,).
TimePoints []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 (,).
AutoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
RetentionDays 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.
repeatWeekdays 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 (,).
timePoints 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 (,).
autoSnapshotPolicyName String

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
retentionDays 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.
repeatWeekdays 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 (,).
timePoints 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 (,).
autoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
retentionDays 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_policy_name str

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
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.
repeatWeekdays 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 (,).
timePoints 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 (,).
autoSnapshotPolicyName String

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
retentionDays 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:

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the automatic snapshot policy.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the automatic snapshot policy.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the automatic snapshot policy.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the automatic snapshot policy.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the automatic snapshot policy.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the automatic snapshot policy.

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.
The following state arguments are supported:
AutoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
RepeatWeekdays 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 (,).
RetentionDays 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.

TimePoints 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 (,).
AutoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
RepeatWeekdays []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 (,).
RetentionDays 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.

TimePoints []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 (,).
autoSnapshotPolicyName String

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
repeatWeekdays 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 (,).
retentionDays 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.

timePoints 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 (,).
autoSnapshotPolicyName string

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
repeatWeekdays 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 (,).
retentionDays 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.

timePoints 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_policy_name str

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
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 (,).
autoSnapshotPolicyName String

The name of the automatic snapshot policy. Limits:

  • The name must be 2 to 128 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:// or https://.
  • The value of this parameter is empty by default.
repeatWeekdays 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 (,).
retentionDays 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.

timePoints 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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.