<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
{
    public static class GetHostShareKeys
    {
        /// <summary>
        /// This data source provides the Bastionhost Host Share Keys of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.165.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "example_value-1",
        ///             "example_value-2",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         NameRegex = "^my-HostShareKey",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["bastionhostHostShareKeyId1"] = ids.Apply(getHostShareKeysResult =&gt; getHostShareKeysResult.Keys[0]?.Id),
        ///         ["bastionhostHostShareKeyId2"] = nameRegex.Apply(getHostShareKeysResult =&gt; getHostShareKeysResult.Keys[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetHostShareKeysResult> InvokeAsync(GetHostShareKeysArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetHostShareKeysResult>("alicloud:bastionhost/getHostShareKeys:getHostShareKeys", args ?? new GetHostShareKeysArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Bastionhost Host Share Keys of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.165.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "example_value-1",
        ///             "example_value-2",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         NameRegex = "^my-HostShareKey",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["bastionhostHostShareKeyId1"] = ids.Apply(getHostShareKeysResult =&gt; getHostShareKeysResult.Keys[0]?.Id),
        ///         ["bastionhostHostShareKeyId2"] = nameRegex.Apply(getHostShareKeysResult =&gt; getHostShareKeysResult.Keys[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetHostShareKeysResult> Invoke(GetHostShareKeysInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetHostShareKeysResult>("alicloud:bastionhost/getHostShareKeys:getHostShareKeys", args ?? new GetHostShareKeysInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetHostShareKeysArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of Host Share Key IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

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

        /// <summary>
        /// A regex string to filter results by Host Share Key name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

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

    public sealed class GetHostShareKeysInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of Host Share Key IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

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

        /// <summary>
        /// A regex string to filter results by Host Share Key name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

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


    [OutputType]
    public sealed class GetHostShareKeysResult
    {
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string InstanceId;
        public readonly ImmutableArray<Outputs.GetHostShareKeysKeyResult> Keys;
        public readonly string? NameRegex;
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;

        [OutputConstructor]
        private GetHostShareKeysResult(
            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            string instanceId,

            ImmutableArray<Outputs.GetHostShareKeysKeyResult> keys,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile)
        {
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            InstanceId = instanceId;
            Keys = keys;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
        }
    }
}
