Auto Snapshot Policy Args
Provides a ECS Auto Snapshot Policy resource. For information about ECS Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy.
NOTE: Available since v1.117.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.ecs.AutoSnapshotPolicy("example", {
name: "terraform-example",
repeatWeekdays: [
"1",
"2",
"3",
],
retentionDays: -1,
timePoints: [
"1",
"22",
"23",
],
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.AutoSnapshotPolicy("example",
name="terraform-example",
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 example = new AliCloud.Ecs.AutoSnapshotPolicy("example", new()
{
Name = "terraform-example",
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.NewAutoSnapshotPolicy(ctx, "example", &ecs.AutoSnapshotPolicyArgs{
Name: pulumi.String("terraform-example"),
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.AutoSnapshotPolicy;
import com.pulumi.alicloud.ecs.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()
.name("terraform-example")
.repeatWeekdays(
"1",
"2",
"3")
.retentionDays(-1)
.timePoints(
"1",
"22",
"23")
.build());
}
}
resources:
example:
type: alicloud:ecs:AutoSnapshotPolicy
properties:
name: terraform-example
repeatWeekdays:
- '1'
- '2'
- '3'
retentionDays: -1
timePoints:
- '1'
- '22'
- '23'
Import
ECS Auto Snapshot Policy can be imported using the id, e.g.
$ pulumi import alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy example <id>
Constructors
Properties
The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
The retention period of the snapshot copy in the destination region. Unit: days. Valid values:
The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration
below.
Specifies whether to enable cross-region replication for snapshots. Valid values: true
, false
.
The days of the week on which to create automatic snapshots. Valid values: 1
to 7
, which correspond to the days of the week. For example, 1
indicates Monday. One or more days can be specified.
The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
The retention period of the automatic snapshots. Unit: days. Valid values:
The destination region to which to copy the snapshot. You can specify only a single destination region.
The points in time of the day at which to create automatic snapshots. The time is displayed in UTC+8. Unit: hours. Valid values: 0
to 23
, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified. The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: "0", "1", ... "23". The following arguments will be discarded. Please use new fields as soon as possible: