<gh_stars>0// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Ecs
{
    /// <summary>
    /// 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](https://www.alibabacloud.com/help/en/doc-detail/25527.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.117.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.Ecs.AutoSnapshotPolicy("example", new()
    ///     {
    ///         RepeatWeekdays = new[]
    ///         {
    ///             "1",
    ///             "2",
    ///             "3",
    ///         },
    ///         RetentionDays = -1,
    ///         TimePoints = new[]
    ///         {
    ///             "1",
    ///             "22",
    ///             "23",
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ECS Auto Snapshot Policy can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy")]
    public partial class AutoSnapshotPolicy : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The retention period of the snapshot copied across regions.
        /// - -1: The snapshot is permanently retained.
        /// - [1, 65535]: The automatic snapshot is retained for the specified number of days.
        /// Default value: -1.
        /// </summary>
        [Output("copiedSnapshotsRetentionDays")]
        public Output<int?> CopiedSnapshotsRetentionDays { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable the system to automatically copy snapshots across regions.
        /// </summary>
        [Output("enableCrossRegionCopy")]
        public Output<bool?> EnableCrossRegionCopy { get; private set; } = null!;

        /// <summary>
        /// The snapshot policy name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// 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 (,).
        /// </summary>
        [Output("repeatWeekdays")]
        public Output<ImmutableArray<string>> RepeatWeekdays { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("retentionDays")]
        public Output<int> RetentionDays { get; private set; } = null!;

        /// <summary>
        /// The status of Auto Snapshot Policy.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;

        /// <summary>
        /// The destination region to which the snapshot is copied. You can set a destination region.
        /// </summary>
        [Output("targetCopyRegions")]
        public Output<ImmutableArray<string>> TargetCopyRegions { get; private set; } = null!;

        /// <summary>
        /// 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 (,).
        /// </summary>
        [Output("timePoints")]
        public Output<ImmutableArray<string>> TimePoints { get; private set; } = null!;


        /// <summary>
        /// Create a AutoSnapshotPolicy resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public AutoSnapshotPolicy(string name, AutoSnapshotPolicyArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy", name, args ?? new AutoSnapshotPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AutoSnapshotPolicy(string name, Input<string> id, AutoSnapshotPolicyState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing AutoSnapshotPolicy resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static AutoSnapshotPolicy Get(string name, Input<string> id, AutoSnapshotPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new AutoSnapshotPolicy(name, id, state, options);
        }
    }

    public sealed class AutoSnapshotPolicyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The retention period of the snapshot copied across regions.
        /// - -1: The snapshot is permanently retained.
        /// - [1, 65535]: The automatic snapshot is retained for the specified number of days.
        /// Default value: -1.
        /// </summary>
        [Input("copiedSnapshotsRetentionDays")]
        public Input<int>? CopiedSnapshotsRetentionDays { get; set; }

        /// <summary>
        /// Specifies whether to enable the system to automatically copy snapshots across regions.
        /// </summary>
        [Input("enableCrossRegionCopy")]
        public Input<bool>? EnableCrossRegionCopy { get; set; }

        /// <summary>
        /// The snapshot policy name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("repeatWeekdays", required: true)]
        private InputList<string>? _repeatWeekdays;

        /// <summary>
        /// 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 (,).
        /// </summary>
        public InputList<string> RepeatWeekdays
        {
            get => _repeatWeekdays ?? (_repeatWeekdays = new InputList<string>());
            set => _repeatWeekdays = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("retentionDays", required: true)]
        public Input<int> RetentionDays { get; set; } = null!;

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        [Input("targetCopyRegions")]
        private InputList<string>? _targetCopyRegions;

        /// <summary>
        /// The destination region to which the snapshot is copied. You can set a destination region.
        /// </summary>
        public InputList<string> TargetCopyRegions
        {
            get => _targetCopyRegions ?? (_targetCopyRegions = new InputList<string>());
            set => _targetCopyRegions = value;
        }

        [Input("timePoints", required: true)]
        private InputList<string>? _timePoints;

        /// <summary>
        /// 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 (,).
        /// </summary>
        public InputList<string> TimePoints
        {
            get => _timePoints ?? (_timePoints = new InputList<string>());
            set => _timePoints = value;
        }

        public AutoSnapshotPolicyArgs()
        {
        }
        public static new AutoSnapshotPolicyArgs Empty => new AutoSnapshotPolicyArgs();
    }

    public sealed class AutoSnapshotPolicyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The retention period of the snapshot copied across regions.
        /// - -1: The snapshot is permanently retained.
        /// - [1, 65535]: The automatic snapshot is retained for the specified number of days.
        /// Default value: -1.
        /// </summary>
        [Input("copiedSnapshotsRetentionDays")]
        public Input<int>? CopiedSnapshotsRetentionDays { get; set; }

        /// <summary>
        /// Specifies whether to enable the system to automatically copy snapshots across regions.
        /// </summary>
        [Input("enableCrossRegionCopy")]
        public Input<bool>? EnableCrossRegionCopy { get; set; }

        /// <summary>
        /// The snapshot policy name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("repeatWeekdays")]
        private InputList<string>? _repeatWeekdays;

        /// <summary>
        /// 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 (,).
        /// </summary>
        public InputList<string> RepeatWeekdays
        {
            get => _repeatWeekdays ?? (_repeatWeekdays = new InputList<string>());
            set => _repeatWeekdays = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("retentionDays")]
        public Input<int>? RetentionDays { get; set; }

        /// <summary>
        /// The status of Auto Snapshot Policy.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        [Input("targetCopyRegions")]
        private InputList<string>? _targetCopyRegions;

        /// <summary>
        /// The destination region to which the snapshot is copied. You can set a destination region.
        /// </summary>
        public InputList<string> TargetCopyRegions
        {
            get => _targetCopyRegions ?? (_targetCopyRegions = new InputList<string>());
            set => _targetCopyRegions = value;
        }

        [Input("timePoints")]
        private InputList<string>? _timePoints;

        /// <summary>
        /// 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 (,).
        /// </summary>
        public InputList<string> TimePoints
        {
            get => _timePoints ?? (_timePoints = new InputList<string>());
            set => _timePoints = value;
        }

        public AutoSnapshotPolicyState()
        {
        }
        public static new AutoSnapshotPolicyState Empty => new AutoSnapshotPolicyState();
    }
}
