AutoSnapshotPolicyArgs

data class AutoSnapshotPolicyArgs(val autoSnapshotPolicyName: Output<String>? = null, val copiedSnapshotsRetentionDays: Output<Int>? = null, val copyEncryptionConfiguration: Output<AutoSnapshotPolicyCopyEncryptionConfigurationArgs>? = null, val enableCrossRegionCopy: Output<Boolean>? = null, val name: Output<String>? = null, val repeatWeekdays: Output<List<String>>? = null, val resourceGroupId: Output<String>? = null, val retentionDays: Output<Int>? = null, val tags: Output<Map<String, String>>? = null, val targetCopyRegions: Output<List<String>>? = null, val timePoints: Output<List<String>>? = null) : ConvertibleToJava<AutoSnapshotPolicyArgs>

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

Link copied to clipboard
constructor(autoSnapshotPolicyName: Output<String>? = null, copiedSnapshotsRetentionDays: Output<Int>? = null, copyEncryptionConfiguration: Output<AutoSnapshotPolicyCopyEncryptionConfigurationArgs>? = null, enableCrossRegionCopy: Output<Boolean>? = null, name: Output<String>? = null, repeatWeekdays: Output<List<String>>? = null, resourceGroupId: Output<String>? = null, retentionDays: Output<Int>? = null, tags: Output<Map<String, String>>? = null, targetCopyRegions: Output<List<String>>? = null, timePoints: Output<List<String>>? = null)

Properties

Link copied to clipboard
val autoSnapshotPolicyName: Output<String>? = null

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 (-).

Link copied to clipboard
val copiedSnapshotsRetentionDays: Output<Int>? = null

The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

Link copied to clipboard

The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.

Link copied to clipboard
val enableCrossRegionCopy: Output<Boolean>? = null

Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.

Link copied to clipboard
val name: Output<String>? = null

. Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

Link copied to clipboard
val repeatWeekdays: Output<List<String>>? = null

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.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

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.

Link copied to clipboard
val retentionDays: Output<Int>? = null

The retention period of the automatic snapshots. Unit: days. Valid values:

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val targetCopyRegions: Output<List<String>>? = null

The destination region to which to copy the snapshot. You can specify only a single destination region.

Link copied to clipboard
val timePoints: Output<List<String>>? = null

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:

Functions

Link copied to clipboard
open override fun toJava(): AutoSnapshotPolicyArgs