<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<filename>sdk/dotnet/Hbr/EcsBackupPlan.cs// *** 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.Hbr
{
    /// <summary>
    /// Provides a HBR Ecs Backup Plan resource.
    /// 
    /// For information about HBR Ecs Backup Plan and how to use it, see [What is Ecs Backup Plan](https://www.alibabacloud.com/help/doc-detail/186574.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.132.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "valut-name";
    ///     var defaultVault = new AliCloud.Hbr.Vault("defaultVault", new()
    ///     {
    ///         VaultName = name,
    ///     });
    /// 
    ///     var defaultInstances = AliCloud.Ecs.GetInstances.Invoke(new()
    ///     {
    ///         NameRegex = "no-deleteing-hbr-ecs-backup-plan",
    ///         Status = "Running",
    ///     });
    /// 
    ///     var example = new AliCloud.Hbr.EcsBackupPlan("example", new()
    ///     {
    ///         EcsBackupPlanName = "example_value",
    ///         InstanceId = defaultInstances.Apply(getInstancesResult =&gt; getInstancesResult.Instances[0]?.Id),
    ///         VaultId = defaultVault.Id,
    ///         Retention = "1",
    ///         Schedule = "I|1602673264|PT2H",
    ///         BackupType = "COMPLETE",
    ///         SpeedLimit = "0:24:5120",
    ///         Paths = new[]
    ///         {
    ///             "/home",
    ///             "/var",
    ///         },
    ///         Exclude = @"  [""/home/exclude""]
    /// ",
    ///         Include = @"  [""/home/include""]
    /// ",
    ///     });
    /// 
    /// });
    /// ```
    /// ## Notice
    /// 
    /// **About Backup path rules:**
    /// 1. If there is no wildcard `*`, you can enter 8 items of path.
    /// 2. When using wildcard `*`, only one item of path can be input, and wildcards like `/*/*` are supported.
    /// 3. Each item of path only supports absolute paths, for example starting with `/`, `\`, `C:\`, `D:\`.
    /// 
    /// **About Restrictions:**
    /// 1. When using `VSS`: multiple paths, UNC paths, wildcards, and excluded files not supported.
    /// 2. When using `UNC`: VSS not supported, wildcards not supported, and files to be excluded are not supported.
    /// 
    /// **About include/exclude path rules:**
    /// 1. Supports up to 8 paths, including paths using wildcards `*`.
    /// 2. If the path does not contain `/`, then `*` matches multiple path names or file names, for example `*abc*` will match `/abc/`, `/d/eabcd/`, `/a/abc`; `*.txt` will match all files with an extension `.txt`.
    /// 3. If the path contains `/`, each `*` only matches a single-level path or file name. For example, `/a/*/*/` share will match `/a/b/c/share`, but not `/a/d/share`.
    /// 4. If the path ends with `/`, it means the folder matches. For example, `*tmp/` will match `/a/b/aaatmp/`, `/tmp/` and so on.
    /// 5. The path separator takes Linux system `/` as an example, if it is Windows system, please replace it with `\`.
    /// 
    /// ## Import
    /// 
    /// HBR Ecs Backup Plan can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:hbr/ecsBackupPlan:EcsBackupPlan example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:hbr/ecsBackupPlan:EcsBackupPlan")]
    public partial class EcsBackupPlan : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Backup type. Valid values: `COMPLETE`.
        /// </summary>
        [Output("backupType")]
        public Output<string> BackupType { get; private set; } = null!;

        /// <summary>
        /// The role name created in the original account RAM backup by the cross account managed by the current account.
        /// </summary>
        [Output("crossAccountRoleName")]
        public Output<string?> CrossAccountRoleName { get; private set; } = null!;

        /// <summary>
        /// The type of the cross account backup. Valid values: `SELF_ACCOUNT`, `CROSS_ACCOUNT`.
        /// </summary>
        [Output("crossAccountType")]
        public Output<string> CrossAccountType { get; private set; } = null!;

        /// <summary>
        /// The original account ID of the cross account backup managed by the current account.
        /// </summary>
        [Output("crossAccountUserId")]
        public Output<int?> CrossAccountUserId { get; private set; } = null!;

        /// <summary>
        /// The detail of the backup plan.
        /// </summary>
        [Output("detail")]
        public Output<string?> Detail { get; private set; } = null!;

        /// <summary>
        /// Whether to disable the backup task. Valid values: `true`, `false`.
        /// </summary>
        [Output("disabled")]
        public Output<bool> Disabled { get; private set; } = null!;

        /// <summary>
        /// The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
        /// </summary>
        [Output("ecsBackupPlanName")]
        public Output<string> EcsBackupPlanName { get; private set; } = null!;

        /// <summary>
        /// Exclude path. String of Json list, up to 255 characters. e.g. `"[\"/home/work\"]"`
        /// </summary>
        [Output("exclude")]
        public Output<string?> Exclude { get; private set; } = null!;

        /// <summary>
        /// Include path. String of Json list, up to 255 characters. e.g. `"[\"/var\"]"`
        /// </summary>
        [Output("include")]
        public Output<string?> Include { get; private set; } = null!;

        /// <summary>
        /// The ID of ECS instance. The ecs backup client must have been installed on the host.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// Windows operating system with application consistency using VSS, e.g: `{\"UseVSS\":false}`.
        /// </summary>
        [Output("options")]
        public Output<string?> Options { get; private set; } = null!;

        /// <summary>
        /// List of backup path. e.g. `["/home", "/var"]`. **Note** If `path` is empty, it means that all directories will be backed up.
        /// </summary>
        [Output("paths")]
        public Output<ImmutableArray<string>> Paths { get; private set; } = null!;

        /// <summary>
        /// Backup retention days, the minimum is 1.
        /// </summary>
        [Output("retention")]
        public Output<string> Retention { get; private set; } = null!;

        /// <summary>
        /// Backup strategy. Optional format: `I|{startTime}|{interval}`. It means to execute a backup task every `{interval}` starting from `{startTime}`. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.
        /// </summary>
        [Output("schedule")]
        public Output<string> Schedule { get; private set; } = null!;

        /// <summary>
        /// Flow control. The format is: `{start}|{end}|{bandwidth}`. Use `|` to separate multiple flow control configurations, multiple flow control configurations not allowed to have overlapping times.
        /// </summary>
        [Output("speedLimit")]
        public Output<string?> SpeedLimit { get; private set; } = null!;

        /// <summary>
        /// Attribute update_paths has been deprecated in v1.139.0+, and you do not need to set it anymore.
        /// </summary>
        [Output("updatePaths")]
        public Output<bool?> UpdatePaths { get; private set; } = null!;

        /// <summary>
        /// The ID of Backup vault.
        /// </summary>
        [Output("vaultId")]
        public Output<string> VaultId { get; private set; } = null!;


        /// <summary>
        /// Create a EcsBackupPlan 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 EcsBackupPlan(string name, EcsBackupPlanArgs args, CustomResourceOptions? options = null)
            : base("alicloud:hbr/ecsBackupPlan:EcsBackupPlan", name, args ?? new EcsBackupPlanArgs(), MakeResourceOptions(options, ""))
        {
        }

        private EcsBackupPlan(string name, Input<string> id, EcsBackupPlanState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:hbr/ecsBackupPlan:EcsBackupPlan", 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 EcsBackupPlan 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 EcsBackupPlan Get(string name, Input<string> id, EcsBackupPlanState? state = null, CustomResourceOptions? options = null)
        {
            return new EcsBackupPlan(name, id, state, options);
        }
    }

    public sealed class EcsBackupPlanArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Backup type. Valid values: `COMPLETE`.
        /// </summary>
        [Input("backupType", required: true)]
        public Input<string> BackupType { get; set; } = null!;

        /// <summary>
        /// The role name created in the original account RAM backup by the cross account managed by the current account.
        /// </summary>
        [Input("crossAccountRoleName")]
        public Input<string>? CrossAccountRoleName { get; set; }

        /// <summary>
        /// The type of the cross account backup. Valid values: `SELF_ACCOUNT`, `CROSS_ACCOUNT`.
        /// </summary>
        [Input("crossAccountType")]
        public Input<string>? CrossAccountType { get; set; }

        /// <summary>
        /// The original account ID of the cross account backup managed by the current account.
        /// </summary>
        [Input("crossAccountUserId")]
        public Input<int>? CrossAccountUserId { get; set; }

        /// <summary>
        /// The detail of the backup plan.
        /// </summary>
        [Input("detail")]
        public Input<string>? Detail { get; set; }

        /// <summary>
        /// Whether to disable the backup task. Valid values: `true`, `false`.
        /// </summary>
        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
        /// </summary>
        [Input("ecsBackupPlanName", required: true)]
        public Input<string> EcsBackupPlanName { get; set; } = null!;

        /// <summary>
        /// Exclude path. String of Json list, up to 255 characters. e.g. `"[\"/home/work\"]"`
        /// </summary>
        [Input("exclude")]
        public Input<string>? Exclude { get; set; }

        /// <summary>
        /// Include path. String of Json list, up to 255 characters. e.g. `"[\"/var\"]"`
        /// </summary>
        [Input("include")]
        public Input<string>? Include { get; set; }

        /// <summary>
        /// The ID of ECS instance. The ecs backup client must have been installed on the host.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// Windows operating system with application consistency using VSS, e.g: `{\"UseVSS\":false}`.
        /// </summary>
        [Input("options")]
        public Input<string>? Options { get; set; }

        [Input("paths")]
        private InputList<string>? _paths;

        /// <summary>
        /// List of backup path. e.g. `["/home", "/var"]`. **Note** If `path` is empty, it means that all directories will be backed up.
        /// </summary>
        public InputList<string> Paths
        {
            get => _paths ?? (_paths = new InputList<string>());
            set => _paths = value;
        }

        /// <summary>
        /// Backup retention days, the minimum is 1.
        /// </summary>
        [Input("retention", required: true)]
        public Input<string> Retention { get; set; } = null!;

        /// <summary>
        /// Backup strategy. Optional format: `I|{startTime}|{interval}`. It means to execute a backup task every `{interval}` starting from `{startTime}`. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.
        /// </summary>
        [Input("schedule", required: true)]
        public Input<string> Schedule { get; set; } = null!;

        /// <summary>
        /// Flow control. The format is: `{start}|{end}|{bandwidth}`. Use `|` to separate multiple flow control configurations, multiple flow control configurations not allowed to have overlapping times.
        /// </summary>
        [Input("speedLimit")]
        public Input<string>? SpeedLimit { get; set; }

        /// <summary>
        /// Attribute update_paths has been deprecated in v1.139.0+, and you do not need to set it anymore.
        /// </summary>
        [Input("updatePaths")]
        public Input<bool>? UpdatePaths { get; set; }

        /// <summary>
        /// The ID of Backup vault.
        /// </summary>
        [Input("vaultId", required: true)]
        public Input<string> VaultId { get; set; } = null!;

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

    public sealed class EcsBackupPlanState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Backup type. Valid values: `COMPLETE`.
        /// </summary>
        [Input("backupType")]
        public Input<string>? BackupType { get; set; }

        /// <summary>
        /// The role name created in the original account RAM backup by the cross account managed by the current account.
        /// </summary>
        [Input("crossAccountRoleName")]
        public Input<string>? CrossAccountRoleName { get; set; }

        /// <summary>
        /// The type of the cross account backup. Valid values: `SELF_ACCOUNT`, `CROSS_ACCOUNT`.
        /// </summary>
        [Input("crossAccountType")]
        public Input<string>? CrossAccountType { get; set; }

        /// <summary>
        /// The original account ID of the cross account backup managed by the current account.
        /// </summary>
        [Input("crossAccountUserId")]
        public Input<int>? CrossAccountUserId { get; set; }

        /// <summary>
        /// The detail of the backup plan.
        /// </summary>
        [Input("detail")]
        public Input<string>? Detail { get; set; }

        /// <summary>
        /// Whether to disable the backup task. Valid values: `true`, `false`.
        /// </summary>
        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
        /// </summary>
        [Input("ecsBackupPlanName")]
        public Input<string>? EcsBackupPlanName { get; set; }

        /// <summary>
        /// Exclude path. String of Json list, up to 255 characters. e.g. `"[\"/home/work\"]"`
        /// </summary>
        [Input("exclude")]
        public Input<string>? Exclude { get; set; }

        /// <summary>
        /// Include path. String of Json list, up to 255 characters. e.g. `"[\"/var\"]"`
        /// </summary>
        [Input("include")]
        public Input<string>? Include { get; set; }

        /// <summary>
        /// The ID of ECS instance. The ecs backup client must have been installed on the host.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// Windows operating system with application consistency using VSS, e.g: `{\"UseVSS\":false}`.
        /// </summary>
        [Input("options")]
        public Input<string>? Options { get; set; }

        [Input("paths")]
        private InputList<string>? _paths;

        /// <summary>
        /// List of backup path. e.g. `["/home", "/var"]`. **Note** If `path` is empty, it means that all directories will be backed up.
        /// </summary>
        public InputList<string> Paths
        {
            get => _paths ?? (_paths = new InputList<string>());
            set => _paths = value;
        }

        /// <summary>
        /// Backup retention days, the minimum is 1.
        /// </summary>
        [Input("retention")]
        public Input<string>? Retention { get; set; }

        /// <summary>
        /// Backup strategy. Optional format: `I|{startTime}|{interval}`. It means to execute a backup task every `{interval}` starting from `{startTime}`. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.
        /// </summary>
        [Input("schedule")]
        public Input<string>? Schedule { get; set; }

        /// <summary>
        /// Flow control. The format is: `{start}|{end}|{bandwidth}`. Use `|` to separate multiple flow control configurations, multiple flow control configurations not allowed to have overlapping times.
        /// </summary>
        [Input("speedLimit")]
        public Input<string>? SpeedLimit { get; set; }

        /// <summary>
        /// Attribute update_paths has been deprecated in v1.139.0+, and you do not need to set it anymore.
        /// </summary>
        [Input("updatePaths")]
        public Input<bool>? UpdatePaths { get; set; }

        /// <summary>
        /// The ID of Backup vault.
        /// </summary>
        [Input("vaultId")]
        public Input<string>? VaultId { get; set; }

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