1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. SnapshotPolicy
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.ecs.SnapshotPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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",
        ])
    
    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
    	})
    }
    
    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 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'
    

    Create SnapshotPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SnapshotPolicy(name: string, args: SnapshotPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def SnapshotPolicy(resource_name: str,
                       args: SnapshotPolicyArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def SnapshotPolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       repeat_weekdays: Optional[Sequence[str]] = None,
                       retention_days: Optional[int] = None,
                       time_points: Optional[Sequence[str]] = None,
                       copied_snapshots_retention_days: Optional[int] = None,
                       enable_cross_region_copy: Optional[bool] = None,
                       name: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       target_copy_regions: Optional[Sequence[str]] = None)
    func NewSnapshotPolicy(ctx *Context, name string, args SnapshotPolicyArgs, opts ...ResourceOption) (*SnapshotPolicy, error)
    public SnapshotPolicy(string name, SnapshotPolicyArgs args, CustomResourceOptions? opts = null)
    public SnapshotPolicy(String name, SnapshotPolicyArgs args)
    public SnapshotPolicy(String name, SnapshotPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:ecs:SnapshotPolicy
    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 SnapshotPolicyArgs
    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 SnapshotPolicyArgs
    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 SnapshotPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SnapshotPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SnapshotPolicyArgs
    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 snapshotPolicyResource = new AliCloud.Ecs.SnapshotPolicy("snapshotPolicyResource", new()
    {
        RepeatWeekdays = new[]
        {
            "string",
        },
        RetentionDays = 0,
        TimePoints = new[]
        {
            "string",
        },
        CopiedSnapshotsRetentionDays = 0,
        EnableCrossRegionCopy = false,
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
        TargetCopyRegions = new[]
        {
            "string",
        },
    });
    
    example, err := ecs.NewSnapshotPolicy(ctx, "snapshotPolicyResource", &ecs.SnapshotPolicyArgs{
    	RepeatWeekdays: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RetentionDays: pulumi.Int(0),
    	TimePoints: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	CopiedSnapshotsRetentionDays: pulumi.Int(0),
    	EnableCrossRegionCopy:        pulumi.Bool(false),
    	Name:                         pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	TargetCopyRegions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var snapshotPolicyResource = new SnapshotPolicy("snapshotPolicyResource", SnapshotPolicyArgs.builder()
        .repeatWeekdays("string")
        .retentionDays(0)
        .timePoints("string")
        .copiedSnapshotsRetentionDays(0)
        .enableCrossRegionCopy(false)
        .name("string")
        .tags(Map.of("string", "string"))
        .targetCopyRegions("string")
        .build());
    
    snapshot_policy_resource = alicloud.ecs.SnapshotPolicy("snapshotPolicyResource",
        repeat_weekdays=["string"],
        retention_days=0,
        time_points=["string"],
        copied_snapshots_retention_days=0,
        enable_cross_region_copy=False,
        name="string",
        tags={
            "string": "string",
        },
        target_copy_regions=["string"])
    
    const snapshotPolicyResource = new alicloud.ecs.SnapshotPolicy("snapshotPolicyResource", {
        repeatWeekdays: ["string"],
        retentionDays: 0,
        timePoints: ["string"],
        copiedSnapshotsRetentionDays: 0,
        enableCrossRegionCopy: false,
        name: "string",
        tags: {
            string: "string",
        },
        targetCopyRegions: ["string"],
    });
    
    type: alicloud:ecs:SnapshotPolicy
    properties:
        copiedSnapshotsRetentionDays: 0
        enableCrossRegionCopy: false
        name: string
        repeatWeekdays:
            - string
        retentionDays: 0
        tags:
            string: string
        targetCopyRegions:
            - string
        timePoints:
            - string
    

    SnapshotPolicy 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 SnapshotPolicy resource accepts the following input properties:

    RepeatWeekdays List<string>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    TimePoints List<string>
    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.

    • 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 (,).
    CopiedSnapshotsRetentionDays int
    EnableCrossRegionCopy bool
    Name string
    The snapshot policy name.
    Tags Dictionary<string, string>
    TargetCopyRegions List<string>
    RepeatWeekdays []string
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    TimePoints []string
    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.

    • 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 (,).
    CopiedSnapshotsRetentionDays int
    EnableCrossRegionCopy bool
    Name string
    The snapshot policy name.
    Tags map[string]string
    TargetCopyRegions []string
    repeatWeekdays List<String>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    timePoints List<String>
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays Integer
    enableCrossRegionCopy Boolean
    name String
    The snapshot policy name.
    tags Map<String,String>
    targetCopyRegions List<String>
    repeatWeekdays string[]
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    timePoints string[]
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays number
    enableCrossRegionCopy boolean
    name string
    The snapshot policy name.
    tags {[key: string]: string}
    targetCopyRegions string[]
    repeat_weekdays Sequence[str]
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    time_points Sequence[str]
    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.

    • 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 (,).
    copied_snapshots_retention_days int
    enable_cross_region_copy bool
    name str
    The snapshot policy name.
    tags Mapping[str, str]
    target_copy_regions Sequence[str]
    repeatWeekdays List<String>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    timePoints List<String>
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays Number
    enableCrossRegionCopy Boolean
    name String
    The snapshot policy name.
    tags Map<String>
    targetCopyRegions List<String>

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SnapshotPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    status String

    Look up Existing SnapshotPolicy Resource

    Get an existing SnapshotPolicy 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?: SnapshotPolicyState, opts?: CustomResourceOptions): SnapshotPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            copied_snapshots_retention_days: Optional[int] = None,
            enable_cross_region_copy: Optional[bool] = None,
            name: Optional[str] = None,
            repeat_weekdays: Optional[Sequence[str]] = None,
            retention_days: Optional[int] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            target_copy_regions: Optional[Sequence[str]] = None,
            time_points: Optional[Sequence[str]] = None) -> SnapshotPolicy
    func GetSnapshotPolicy(ctx *Context, name string, id IDInput, state *SnapshotPolicyState, opts ...ResourceOption) (*SnapshotPolicy, error)
    public static SnapshotPolicy Get(string name, Input<string> id, SnapshotPolicyState? state, CustomResourceOptions? opts = null)
    public static SnapshotPolicy get(String name, Output<String> id, SnapshotPolicyState 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:
    CopiedSnapshotsRetentionDays int
    EnableCrossRegionCopy bool
    Name string
    The snapshot policy name.
    RepeatWeekdays List<string>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    Status string
    Tags Dictionary<string, string>
    TargetCopyRegions List<string>
    TimePoints List<string>
    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.

    • 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 (,).
    CopiedSnapshotsRetentionDays int
    EnableCrossRegionCopy bool
    Name string
    The snapshot policy name.
    RepeatWeekdays []string
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    Status string
    Tags map[string]string
    TargetCopyRegions []string
    TimePoints []string
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays Integer
    enableCrossRegionCopy Boolean
    name String
    The snapshot policy name.
    repeatWeekdays List<String>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    status String
    tags Map<String,String>
    targetCopyRegions List<String>
    timePoints List<String>
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays number
    enableCrossRegionCopy boolean
    name string
    The snapshot policy name.
    repeatWeekdays string[]
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    status string
    tags {[key: string]: string}
    targetCopyRegions string[]
    timePoints string[]
    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.

    • 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 (,).
    copied_snapshots_retention_days int
    enable_cross_region_copy bool
    name str
    The snapshot policy name.
    repeat_weekdays Sequence[str]
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    status str
    tags Mapping[str, str]
    target_copy_regions Sequence[str]
    time_points Sequence[str]
    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.

    • 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 (,).
    copiedSnapshotsRetentionDays Number
    enableCrossRegionCopy Boolean
    name String
    The snapshot policy name.
    repeatWeekdays List<String>
    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.

    • A maximum of seven 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 snapshot retention time, and the unit of measurement is day. Optional values:

    • -1: The automatic snapshots are retained permanently.
    • [1, 65536]: The number of days retained.

    Default value: -1.

    status String
    tags Map<String>
    targetCopyRegions List<String>
    timePoints List<String>
    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.

    • 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

    Snapshot can be imported using the id, e.g.

    $ pulumi import alicloud:ecs/snapshotPolicy:SnapshotPolicy snapshot sp-abc1234567890000
    

    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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi