// *** 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 Command resource.
    /// 
    /// For information about ECS Command and how to use it, see [What is Command](https://www.alibabacloud.com/help/en/doc-detail/64844.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.116.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.Command("example", new()
    ///     {
    ///         CommandContent = "bHMK",
    ///         Description = "For Terraform Test",
    ///         Type = "RunShellScript",
    ///         WorkingDir = "/root",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ECS Command can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ecs/command:Command example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ecs/command:Command")]
    public partial class Command : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The Base64-encoded content of the command.
        /// </summary>
        [Output("commandContent")]
        public Output<string> CommandContent { get; private set; } = null!;

        /// <summary>
        /// The description of command.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to use custom parameters in the command to be created. Default to: false.
        /// </summary>
        [Output("enableParameter")]
        public Output<bool?> EnableParameter { get; private set; } = null!;

        /// <summary>
        /// The name of the command, which supports all character sets. It can be up to 128 characters in length.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The timeout period that is specified for the command to be run on ECS instances. Unit: seconds. Default to: `60`.
        /// </summary>
        [Output("timeout")]
        public Output<int?> Timeout { get; private set; } = null!;

        /// <summary>
        /// The command type. Valid Values: `RunBatScript`, `RunPowerShellScript` and `RunShellScript`.
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;

        /// <summary>
        /// The execution path of the command in the ECS instance.
        /// </summary>
        [Output("workingDir")]
        public Output<string?> WorkingDir { get; private set; } = null!;


        /// <summary>
        /// Create a Command 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 Command(string name, CommandArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ecs/command:Command", name, args ?? new CommandArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class CommandArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Base64-encoded content of the command.
        /// </summary>
        [Input("commandContent", required: true)]
        public Input<string> CommandContent { get; set; } = null!;

        /// <summary>
        /// The description of command.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specifies whether to use custom parameters in the command to be created. Default to: false.
        /// </summary>
        [Input("enableParameter")]
        public Input<bool>? EnableParameter { get; set; }

        /// <summary>
        /// The name of the command, which supports all character sets. It can be up to 128 characters in length.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The timeout period that is specified for the command to be run on ECS instances. Unit: seconds. Default to: `60`.
        /// </summary>
        [Input("timeout")]
        public Input<int>? Timeout { get; set; }

        /// <summary>
        /// The command type. Valid Values: `RunBatScript`, `RunPowerShellScript` and `RunShellScript`.
        /// </summary>
        [Input("type", required: true)]
        public Input<string> Type { get; set; } = null!;

        /// <summary>
        /// The execution path of the command in the ECS instance.
        /// </summary>
        [Input("workingDir")]
        public Input<string>? WorkingDir { get; set; }

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

    public sealed class CommandState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Base64-encoded content of the command.
        /// </summary>
        [Input("commandContent")]
        public Input<string>? CommandContent { get; set; }

        /// <summary>
        /// The description of command.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specifies whether to use custom parameters in the command to be created. Default to: false.
        /// </summary>
        [Input("enableParameter")]
        public Input<bool>? EnableParameter { get; set; }

        /// <summary>
        /// The name of the command, which supports all character sets. It can be up to 128 characters in length.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The timeout period that is specified for the command to be run on ECS instances. Unit: seconds. Default to: `60`.
        /// </summary>
        [Input("timeout")]
        public Input<int>? Timeout { get; set; }

        /// <summary>
        /// The command type. Valid Values: `RunBatScript`, `RunPowerShellScript` and `RunShellScript`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// The execution path of the command in the ECS instance.
        /// </summary>
        [Input("workingDir")]
        public Input<string>? WorkingDir { get; set; }

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