<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.BastionHost
{
    /// <summary>
    /// Provides a Bastion Host Share Key resource.
    /// 
    /// For information about Bastion Host Host Share Key and how to use it, see [What is Host Share Key](https://www.alibabacloud.com/help/en/bastion-host/latest/createhostsharekey).
    /// 
    /// &gt; **NOTE:** Available in v1.165.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultInstances = AliCloud.BastionHost.GetInstances.Invoke();
    /// 
    ///     var defaultHostShareKey = new AliCloud.BastionHost.HostShareKey("defaultHostShareKey", new()
    ///     {
    ///         HostShareKeyName = "example_name",
    ///         InstanceId = defaultInstances.Apply(getInstancesResult =&gt; getInstancesResult.Instances[0]?.Id),
    ///         PassPhrase = "example_value",
    ///         PrivateKey = "example_value",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Bastion Host Share Key can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:bastionhost/hostShareKey:HostShareKey example &lt;instance_id&gt;:&lt;host_share_key_id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:bastionhost/hostShareKey:HostShareKey")]
    public partial class HostShareKey : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The first ID of the resource.
        /// </summary>
        [Output("hostShareKeyId")]
        public Output<string> HostShareKeyId { get; private set; } = null!;

        /// <summary>
        /// The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
        /// </summary>
        [Output("hostShareKeyName")]
        public Output<string> HostShareKeyName { get; private set; } = null!;

        /// <summary>
        /// The ID of the Bastion instance.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The password of the private key. The value is a Base64-encoded string.
        /// </summary>
        [Output("passPhrase")]
        public Output<string?> PassPhrase { get; private set; } = null!;

        /// <summary>
        /// The private key. The value is a Base64-encoded string.
        /// </summary>
        [Output("privateKey")]
        public Output<string> PrivateKey { get; private set; } = null!;

        /// <summary>
        /// The fingerprint of the private key.
        /// </summary>
        [Output("privateKeyFingerPrint")]
        public Output<string> PrivateKeyFingerPrint { get; private set; } = null!;


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

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

    public sealed class HostShareKeyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
        /// </summary>
        [Input("hostShareKeyName", required: true)]
        public Input<string> HostShareKeyName { get; set; } = null!;

        /// <summary>
        /// The ID of the Bastion instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The password of the private key. The value is a Base64-encoded string.
        /// </summary>
        [Input("passPhrase")]
        public Input<string>? PassPhrase { get; set; }

        /// <summary>
        /// The private key. The value is a Base64-encoded string.
        /// </summary>
        [Input("privateKey", required: true)]
        public Input<string> PrivateKey { get; set; } = null!;

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

    public sealed class HostShareKeyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The first ID of the resource.
        /// </summary>
        [Input("hostShareKeyId")]
        public Input<string>? HostShareKeyId { get; set; }

        /// <summary>
        /// The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
        /// </summary>
        [Input("hostShareKeyName")]
        public Input<string>? HostShareKeyName { get; set; }

        /// <summary>
        /// The ID of the Bastion instance.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The password of the private key. The value is a Base64-encoded string.
        /// </summary>
        [Input("passPhrase")]
        public Input<string>? PassPhrase { get; set; }

        /// <summary>
        /// The private key. The value is a Base64-encoded string.
        /// </summary>
        [Input("privateKey")]
        public Input<string>? PrivateKey { get; set; }

        /// <summary>
        /// The fingerprint of the private key.
        /// </summary>
        [Input("privateKeyFingerPrint")]
        public Input<string>? PrivateKeyFingerPrint { get; set; }

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