<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<filename>sdk/dotnet/BastionHost/HostAccount.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.BastionHost
{
    /// <summary>
    /// Provides a Bastion Host Host Account resource.
    /// 
    /// For information about Bastion Host Host Account and how to use it, see [What is Host Account](https://www.alibabacloud.com/help/en/doc-detail/204377.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.135.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.BastionHost.HostAccount("example", new()
    ///     {
    ///         HostAccountName = "example_value",
    ///         HostId = "15",
    ///         InstanceId = "bastionhost-cn-tl32bh0no30",
    ///         Password = "YourPassword12345",
    ///         ProtocolName = "SSH",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Bastion Host Host Account can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:bastionhost/hostAccount:HostAccount example &lt;instance_id&gt;:&lt;host_account_id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:bastionhost/hostAccount:HostAccount")]
    public partial class HostAccount : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Hosting account ID.
        /// </summary>
        [Output("hostAccountId")]
        public Output<string> HostAccountId { get; private set; } = null!;

        /// <summary>
        /// The name of the host account. The name can be up to 128 characters in length.
        /// </summary>
        [Output("hostAccountName")]
        public Output<string> HostAccountName { get; private set; } = null!;

        /// <summary>
        /// The ID of the host for which you want to create an account.
        /// </summary>
        [Output("hostId")]
        public Output<string> HostId { get; private set; } = null!;

        /// <summary>
        /// The ID of the Bastionhost instance where you want to create an account for the host.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The passphrase of the private key for the host account. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`.
        /// </summary>
        [Output("passPhrase")]
        public Output<string?> PassPhrase { get; private set; } = null!;

        /// <summary>
        /// The password of the host account.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        /// <summary>
        /// The private key of the host account. The value is a Base64-encoded string. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`
        /// </summary>
        [Output("privateKey")]
        public Output<string?> PrivateKey { get; private set; } = null!;

        /// <summary>
        /// The protocol used by the host account. Valid values: SSH,RDP
        /// </summary>
        [Output("protocolName")]
        public Output<string> ProtocolName { get; private set; } = null!;


        /// <summary>
        /// Create a HostAccount 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 HostAccount(string name, HostAccountArgs args, CustomResourceOptions? options = null)
            : base("alicloud:bastionhost/hostAccount:HostAccount", name, args ?? new HostAccountArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class HostAccountArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the host account. The name can be up to 128 characters in length.
        /// </summary>
        [Input("hostAccountName", required: true)]
        public Input<string> HostAccountName { get; set; } = null!;

        /// <summary>
        /// The ID of the host for which you want to create an account.
        /// </summary>
        [Input("hostId", required: true)]
        public Input<string> HostId { get; set; } = null!;

        /// <summary>
        /// The ID of the Bastionhost instance where you want to create an account for the host.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The passphrase of the private key for the host account. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`.
        /// </summary>
        [Input("passPhrase")]
        public Input<string>? PassPhrase { get; set; }

        /// <summary>
        /// The password of the host account.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The private key of the host account. The value is a Base64-encoded string. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`
        /// </summary>
        [Input("privateKey")]
        public Input<string>? PrivateKey { get; set; }

        /// <summary>
        /// The protocol used by the host account. Valid values: SSH,RDP
        /// </summary>
        [Input("protocolName", required: true)]
        public Input<string> ProtocolName { get; set; } = null!;

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

    public sealed class HostAccountState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Hosting account ID.
        /// </summary>
        [Input("hostAccountId")]
        public Input<string>? HostAccountId { get; set; }

        /// <summary>
        /// The name of the host account. The name can be up to 128 characters in length.
        /// </summary>
        [Input("hostAccountName")]
        public Input<string>? HostAccountName { get; set; }

        /// <summary>
        /// The ID of the host for which you want to create an account.
        /// </summary>
        [Input("hostId")]
        public Input<string>? HostId { get; set; }

        /// <summary>
        /// The ID of the Bastionhost instance where you want to create an account for the host.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The passphrase of the private key for the host account. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`.
        /// </summary>
        [Input("passPhrase")]
        public Input<string>? PassPhrase { get; set; }

        /// <summary>
        /// The password of the host account.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The private key of the host account. The value is a Base64-encoded string. **NOTE:** It is valid when the attribute `protocol_name` is `SSH`
        /// </summary>
        [Input("privateKey")]
        public Input<string>? PrivateKey { get; set; }

        /// <summary>
        /// The protocol used by the host account. Valid values: SSH,RDP
        /// </summary>
        [Input("protocolName")]
        public Input<string>? ProtocolName { get; set; }

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