alicloud.nas.AutoSnapshotPolicy
Explore with Pulumi AI
Provides a NAS Auto Snapshot Policy resource. Automatic snapshot policy.
For information about NAS Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy).
NOTE: Available since v1.153.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.nas.AutoSnapshotPolicy("default", {
timePoints: [
"0",
"1",
"2",
],
retentionDays: 1,
repeatWeekdays: [
"2",
"3",
"4",
],
autoSnapshotPolicyName: name,
fileSystemType: "extreme",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.nas.AutoSnapshotPolicy("default",
time_points=[
"0",
"1",
"2",
],
retention_days=1,
repeat_weekdays=[
"2",
"3",
"4",
],
auto_snapshot_policy_name=name,
file_system_type="extreme")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := nas.NewAutoSnapshotPolicy(ctx, "default", &nas.AutoSnapshotPolicyArgs{
TimePoints: pulumi.StringArray{
pulumi.String("0"),
pulumi.String("1"),
pulumi.String("2"),
},
RetentionDays: pulumi.Int(1),
RepeatWeekdays: pulumi.StringArray{
pulumi.String("2"),
pulumi.String("3"),
pulumi.String("4"),
},
AutoSnapshotPolicyName: pulumi.String(name),
FileSystemType: pulumi.String("extreme"),
})
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 config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Nas.AutoSnapshotPolicy("default", new()
{
TimePoints = new[]
{
"0",
"1",
"2",
},
RetentionDays = 1,
RepeatWeekdays = new[]
{
"2",
"3",
"4",
},
AutoSnapshotPolicyName = name,
FileSystemType = "extreme",
});
});
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new AutoSnapshotPolicy("default", AutoSnapshotPolicyArgs.builder()
.timePoints(
"0",
"1",
"2")
.retentionDays("1")
.repeatWeekdays(
"2",
"3",
"4")
.autoSnapshotPolicyName(name)
.fileSystemType("extreme")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:nas:AutoSnapshotPolicy
properties:
timePoints:
- '0'
- '1'
- '2'
retentionDays: '1'
repeatWeekdays:
- '2'
- '3'
- '4'
autoSnapshotPolicyName: ${name}
fileSystemType: extreme
Create AutoSnapshotPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AutoSnapshotPolicy(name: string, args: AutoSnapshotPolicyArgs, opts?: CustomResourceOptions);
@overload
def AutoSnapshotPolicy(resource_name: str,
args: AutoSnapshotPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AutoSnapshotPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
repeat_weekdays: Optional[Sequence[str]] = None,
time_points: Optional[Sequence[str]] = None,
auto_snapshot_policy_name: Optional[str] = None,
file_system_type: Optional[str] = None,
retention_days: Optional[int] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var alicloudAutoSnapshotPolicyResource = new AliCloud.Nas.AutoSnapshotPolicy("alicloudAutoSnapshotPolicyResource", new()
{
RepeatWeekdays = new[]
{
"string",
},
TimePoints = new[]
{
"string",
},
AutoSnapshotPolicyName = "string",
FileSystemType = "string",
RetentionDays = 0,
});
example, err := nas.NewAutoSnapshotPolicy(ctx, "alicloudAutoSnapshotPolicyResource", &nas.AutoSnapshotPolicyArgs{
RepeatWeekdays: pulumi.StringArray{
pulumi.String("string"),
},
TimePoints: pulumi.StringArray{
pulumi.String("string"),
},
AutoSnapshotPolicyName: pulumi.String("string"),
FileSystemType: pulumi.String("string"),
RetentionDays: pulumi.Int(0),
})
var alicloudAutoSnapshotPolicyResource = new AutoSnapshotPolicy("alicloudAutoSnapshotPolicyResource", AutoSnapshotPolicyArgs.builder()
.repeatWeekdays("string")
.timePoints("string")
.autoSnapshotPolicyName("string")
.fileSystemType("string")
.retentionDays(0)
.build());
alicloud_auto_snapshot_policy_resource = alicloud.nas.AutoSnapshotPolicy("alicloudAutoSnapshotPolicyResource",
repeat_weekdays=["string"],
time_points=["string"],
auto_snapshot_policy_name="string",
file_system_type="string",
retention_days=0)
const alicloudAutoSnapshotPolicyResource = new alicloud.nas.AutoSnapshotPolicy("alicloudAutoSnapshotPolicyResource", {
repeatWeekdays: ["string"],
timePoints: ["string"],
autoSnapshotPolicyName: "string",
fileSystemType: "string",
retentionDays: 0,
});
type: alicloud:nas:AutoSnapshotPolicy
properties:
autoSnapshotPolicyName: string
fileSystemType: string
repeatWeekdays:
- string
retentionDays: 0
timePoints:
- string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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
- File
System stringType - The file system type.
- 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
- File
System stringType - The file system type.
- 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
- file
System StringType - The file system type.
- 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
- file
System stringType - The file system type.
- 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
- file_
system_ strtype - The file system type.
- 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
- file
System StringType - The file system type.
- 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:
- Create
Time string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the automatic snapshot policy.
- Create
Time string - Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the automatic snapshot policy.
- create
Time String - Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the automatic snapshot policy.
- create
Time string - Creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The status of the automatic snapshot policy.
- create_
time str - Creation time.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The status of the automatic snapshot policy.
- create
Time String - Creation time.
- 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,
create_time: Optional[str] = None,
file_system_type: 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
- Create
Time string - Creation time.
- File
System stringType - The file system type.
- 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
- Create
Time string - Creation time.
- File
System stringType - The file system type.
- 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
- create
Time String - Creation time.
- file
System StringType - The file system type.
- 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
- create
Time string - Creation time.
- file
System stringType - The file system type.
- 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
- create_
time str - Creation time.
- file_
system_ strtype - The file system type.
- 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
- create
Time String - Creation time.
- file
System StringType - The file system type.
- 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
NAS Auto Snapshot Policy can be imported using the id, e.g.
$ pulumi import alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy example <id>
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.