Snapshot Policy Args
DEPRECATED: This resource has been renamed to alicloud.ecs.AutoSnapshotPolicy from version 1.117.0. Provides an ECS snapshot policy resource. For information about snapshot policy and how to use it, see Snapshot. NOTE: Available in 1.42.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const sp = new alicloud.ecs.SnapshotPolicy("sp", {
name: "tf-testAcc-sp",
repeatWeekdays: [
"1",
"2",
"3",
],
retentionDays: -1,
timePoints: [
"1",
"22",
"23",
],
});
import pulumi
import pulumi_alicloud as alicloud
sp = alicloud.ecs.SnapshotPolicy("sp",
name="tf-testAcc-sp",
repeat_weekdays=[
"1",
"2",
"3",
],
retention_days=-1,
time_points=[
"1",
"22",
"23",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var sp = new AliCloud.Ecs.SnapshotPolicy("sp", new()
{
Name = "tf-testAcc-sp",
RepeatWeekdays = new[]
{
"1",
"2",
"3",
},
RetentionDays = -1,
TimePoints = new[]
{
"1",
"22",
"23",
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewSnapshotPolicy(ctx, "sp", &ecs.SnapshotPolicyArgs{
Name: pulumi.String("tf-testAcc-sp"),
RepeatWeekdays: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("3"),
},
RetentionDays: pulumi.Int(-1),
TimePoints: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("22"),
pulumi.String("23"),
},
})
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.ecs.SnapshotPolicy;
import com.pulumi.alicloud.ecs.SnapshotPolicyArgs;
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 sp = new SnapshotPolicy("sp", SnapshotPolicyArgs.builder()
.name("tf-testAcc-sp")
.repeatWeekdays(
"1",
"2",
"3")
.retentionDays(-1)
.timePoints(
"1",
"22",
"23")
.build());
}
}
resources:
sp:
type: alicloud:ecs:SnapshotPolicy
properties:
name: tf-testAcc-sp
repeatWeekdays:
- '1'
- '2'
- '3'
retentionDays: -1
timePoints:
- '1'
- '22'
- '23'
Import
Snapshot can be imported using the id, e.g.
$ pulumi import alicloud:ecs/snapshotPolicy:SnapshotPolicy snapshot sp-abc1234567890000
Constructors
Properties
The automatic snapshot repetition dates. The unit of measurement is day and the repeating cycle is a week. Value range: 1, 7, which represents days starting from Monday to Sunday, for example 1 indicates Monday. When you want to schedule multiple automatic snapshot tasks for a disk in a week, you can set the RepeatWeekdays to an array.
The snapshot retention time, and the unit of measurement is day. Optional values:
The automatic snapshot creation schedule, and the unit of measurement is hour. Value range: 0, 23, which represents from 00:00 to 24:00, for example 1 indicates 01:00. When you want to schedule multiple automatic snapshot tasks for a disk in a day, you can set the TimePoints to an array.