<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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
{
    public static class GetDedicatedHosts
    {
        /// <summary>
        /// This data source provides a list of ECS Dedicated Hosts in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.91.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var dedicatedHostsDs = AliCloud.Ecs.GetDedicatedHosts.Invoke(new()
        ///     {
        ///         DedicatedHostType = "ddh.g5",
        ///         NameRegex = "tf-testAcc",
        ///         Status = "Available",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstDedicatedHostsId"] = dedicatedHostsDs.Apply(getDedicatedHostsResult =&gt; getDedicatedHostsResult.Hosts[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDedicatedHostsResult> InvokeAsync(GetDedicatedHostsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetDedicatedHostsResult>("alicloud:ecs/getDedicatedHosts:getDedicatedHosts", args ?? new GetDedicatedHostsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides a list of ECS Dedicated Hosts in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.91.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var dedicatedHostsDs = AliCloud.Ecs.GetDedicatedHosts.Invoke(new()
        ///     {
        ///         DedicatedHostType = "ddh.g5",
        ///         NameRegex = "tf-testAcc",
        ///         Status = "Available",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstDedicatedHostsId"] = dedicatedHostsDs.Apply(getDedicatedHostsResult =&gt; getDedicatedHostsResult.Hosts[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDedicatedHostsResult> Invoke(GetDedicatedHostsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetDedicatedHostsResult>("alicloud:ecs/getDedicatedHosts:getDedicatedHosts", args ?? new GetDedicatedHostsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDedicatedHostsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The ID of ECS Dedicated Host.
        /// </summary>
        [Input("dedicatedHostId")]
        public string? DedicatedHostId { get; set; }

        /// <summary>
        /// The name of ECS Dedicated Host.
        /// </summary>
        [Input("dedicatedHostName")]
        public string? DedicatedHostName { get; set; }

        /// <summary>
        /// The type of the dedicated host.
        /// </summary>
        [Input("dedicatedHostType")]
        public string? DedicatedHostType { get; set; }

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

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

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

        [Input("operationLocks")]
        private List<Inputs.GetDedicatedHostsOperationLockArgs>? _operationLocks;

        /// <summary>
        /// The reason why the dedicated host resource is locked.
        /// </summary>
        public List<Inputs.GetDedicatedHostsOperationLockArgs> OperationLocks
        {
            get => _operationLocks ?? (_operationLocks = new List<Inputs.GetDedicatedHostsOperationLockArgs>());
            set => _operationLocks = value;
        }

        /// <summary>
        /// Save the result to the file.
        /// </summary>
        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// The ID of the resource group to which the ECS Dedicated Host belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public string? ResourceGroupId { get; set; }

        /// <summary>
        /// The status of the ECS Dedicated Host. validate value: `Available`, `Creating`, `PermanentFailure`, `Released`, `UnderAssessment`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        /// <summary>
        /// The zone ID of the ECS Dedicated Host.
        /// </summary>
        [Input("zoneId")]
        public string? ZoneId { get; set; }

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

    public sealed class GetDedicatedHostsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The ID of ECS Dedicated Host.
        /// </summary>
        [Input("dedicatedHostId")]
        public Input<string>? DedicatedHostId { get; set; }

        /// <summary>
        /// The name of ECS Dedicated Host.
        /// </summary>
        [Input("dedicatedHostName")]
        public Input<string>? DedicatedHostName { get; set; }

        /// <summary>
        /// The type of the dedicated host.
        /// </summary>
        [Input("dedicatedHostType")]
        public Input<string>? DedicatedHostType { get; set; }

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

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

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

        [Input("operationLocks")]
        private InputList<Inputs.GetDedicatedHostsOperationLockInputArgs>? _operationLocks;

        /// <summary>
        /// The reason why the dedicated host resource is locked.
        /// </summary>
        public InputList<Inputs.GetDedicatedHostsOperationLockInputArgs> OperationLocks
        {
            get => _operationLocks ?? (_operationLocks = new InputList<Inputs.GetDedicatedHostsOperationLockInputArgs>());
            set => _operationLocks = value;
        }

        /// <summary>
        /// Save the result to the file.
        /// </summary>
        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        /// <summary>
        /// The ID of the resource group to which the ECS Dedicated Host belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The status of the ECS Dedicated Host. validate value: `Available`, `Creating`, `PermanentFailure`, `Released`, `UnderAssessment`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// The zone ID of the ECS Dedicated Host.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

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


    [OutputType]
    public sealed class GetDedicatedHostsResult
    {
        /// <summary>
        /// ID of the ECS Dedicated Host.
        /// </summary>
        public readonly string? DedicatedHostId;
        /// <summary>
        /// The name of the dedicated host.
        /// </summary>
        public readonly string? DedicatedHostName;
        /// <summary>
        /// The type of the dedicated host.
        /// </summary>
        public readonly string? DedicatedHostType;
        /// <summary>
        /// A list of ECS Dedicated Hosts. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetDedicatedHostsHostResult> Hosts;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of ECS Dedicated Host ids.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly string? NameRegex;
        /// <summary>
        /// A list of ECS Dedicated Host names.
        /// </summary>
        public readonly ImmutableArray<string> Names;
        /// <summary>
        /// (Available in 1.123.1+) The operation_locks. contains the following attribute:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetDedicatedHostsOperationLockResult> OperationLocks;
        public readonly string? OutputFile;
        /// <summary>
        /// The ID of the resource group to which the dedicated host belongs.
        /// </summary>
        public readonly string? ResourceGroupId;
        /// <summary>
        /// The service status of the dedicated host.
        /// </summary>
        public readonly string? Status;
        public readonly ImmutableDictionary<string, object>? Tags;
        public readonly string? ZoneId;

        [OutputConstructor]
        private GetDedicatedHostsResult(
            string? dedicatedHostId,

            string? dedicatedHostName,

            string? dedicatedHostType,

            ImmutableArray<Outputs.GetDedicatedHostsHostResult> hosts,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            ImmutableArray<string> names,

            ImmutableArray<Outputs.GetDedicatedHostsOperationLockResult> operationLocks,

            string? outputFile,

            string? resourceGroupId,

            string? status,

            ImmutableDictionary<string, object>? tags,

            string? zoneId)
        {
            DedicatedHostId = dedicatedHostId;
            DedicatedHostName = dedicatedHostName;
            DedicatedHostType = dedicatedHostType;
            Hosts = hosts;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            Names = names;
            OperationLocks = operationLocks;
            OutputFile = outputFile;
            ResourceGroupId = resourceGroupId;
            Status = status;
            Tags = tags;
            ZoneId = zoneId;
        }
    }
}
