// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Clb
{
    public static class GetTargetGroups
    {
        /// <summary>
        /// Use this data source to query target group information.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var clbBasic = new Tencentcloud.Clb.Instance("clbBasic", new Tencentcloud.Clb.InstanceArgs
        ///         {
        ///             NetworkType = "OPEN",
        ///             ClbName = "tf-clb-rule-basic",
        ///         });
        ///         var listenerBasic = new Tencentcloud.Clb.Listener("listenerBasic", new Tencentcloud.Clb.ListenerArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             Port = 1,
        ///             Protocol = "HTTP",
        ///             ListenerName = "listener_basic",
        ///         });
        ///         var ruleBasic = new Tencentcloud.Clb.ListenerRule("ruleBasic", new Tencentcloud.Clb.ListenerRuleArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             ListenerId = listenerBasic.ListenerId,
        ///             Domain = "abc.com",
        ///             Url = "/",
        ///             SessionExpireTime = 30,
        ///             Scheduler = "WRR",
        ///             TargetType = "TARGETGROUP",
        ///         });
        ///         var test = new Tencentcloud.Clb.TargetGroup("test", new Tencentcloud.Clb.TargetGroupArgs
        ///         {
        ///             TargetGroupName = "test-target-keep-1",
        ///         });
        ///         var @group = new Tencentcloud.Clb.TargetGroupAttachment("group", new Tencentcloud.Clb.TargetGroupAttachmentArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             ListenerId = listenerBasic.ListenerId,
        ///             RuleId = ruleBasic.RuleId,
        ///             TargrtGroupId = test.Id,
        ///         });
        ///         var targetGroupInfoId = Tencentcloud.Clb.GetTargetGroups.Invoke(new Tencentcloud.Clb.GetTargetGroupsInvokeArgs
        ///         {
        ///             TargetGroupId = test.Id,
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetTargetGroupsResult> InvokeAsync(GetTargetGroupsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetTargetGroupsResult>("tencentcloud:Clb/getTargetGroups:getTargetGroups", args ?? new GetTargetGroupsArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query target group information.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var clbBasic = new Tencentcloud.Clb.Instance("clbBasic", new Tencentcloud.Clb.InstanceArgs
        ///         {
        ///             NetworkType = "OPEN",
        ///             ClbName = "tf-clb-rule-basic",
        ///         });
        ///         var listenerBasic = new Tencentcloud.Clb.Listener("listenerBasic", new Tencentcloud.Clb.ListenerArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             Port = 1,
        ///             Protocol = "HTTP",
        ///             ListenerName = "listener_basic",
        ///         });
        ///         var ruleBasic = new Tencentcloud.Clb.ListenerRule("ruleBasic", new Tencentcloud.Clb.ListenerRuleArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             ListenerId = listenerBasic.ListenerId,
        ///             Domain = "abc.com",
        ///             Url = "/",
        ///             SessionExpireTime = 30,
        ///             Scheduler = "WRR",
        ///             TargetType = "TARGETGROUP",
        ///         });
        ///         var test = new Tencentcloud.Clb.TargetGroup("test", new Tencentcloud.Clb.TargetGroupArgs
        ///         {
        ///             TargetGroupName = "test-target-keep-1",
        ///         });
        ///         var @group = new Tencentcloud.Clb.TargetGroupAttachment("group", new Tencentcloud.Clb.TargetGroupAttachmentArgs
        ///         {
        ///             ClbId = clbBasic.Id,
        ///             ListenerId = listenerBasic.ListenerId,
        ///             RuleId = ruleBasic.RuleId,
        ///             TargrtGroupId = test.Id,
        ///         });
        ///         var targetGroupInfoId = Tencentcloud.Clb.GetTargetGroups.Invoke(new Tencentcloud.Clb.GetTargetGroupsInvokeArgs
        ///         {
        ///             TargetGroupId = test.Id,
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetTargetGroupsResult> Invoke(GetTargetGroupsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetTargetGroupsResult>("tencentcloud:Clb/getTargetGroups:getTargetGroups", args ?? new GetTargetGroupsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetTargetGroupsArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of Target group. Mutually exclusive with `vpc_id` and `target_group_name`. `target_group_id` is preferred.
        /// </summary>
        [Input("targetGroupId")]
        public string? TargetGroupId { get; set; }

        /// <summary>
        /// Name of target group. Mutually exclusive with `target_group_id`. `target_group_id` is preferred.
        /// </summary>
        [Input("targetGroupName")]
        public string? TargetGroupName { get; set; }

        /// <summary>
        /// Target group VPC ID. Mutually exclusive with `target_group_id`. `target_group_id` is preferred.
        /// </summary>
        [Input("vpcId")]
        public string? VpcId { get; set; }

        public GetTargetGroupsArgs()
        {
        }
    }

    public sealed class GetTargetGroupsInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of Target group. Mutually exclusive with `vpc_id` and `target_group_name`. `target_group_id` is preferred.
        /// </summary>
        [Input("targetGroupId")]
        public Input<string>? TargetGroupId { get; set; }

        /// <summary>
        /// Name of target group. Mutually exclusive with `target_group_id`. `target_group_id` is preferred.
        /// </summary>
        [Input("targetGroupName")]
        public Input<string>? TargetGroupName { get; set; }

        /// <summary>
        /// Target group VPC ID. Mutually exclusive with `target_group_id`. `target_group_id` is preferred.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public GetTargetGroupsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetTargetGroupsResult
    {
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Target group info list.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetTargetGroupsListResult> Lists;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// ID of Target group.
        /// </summary>
        public readonly string? TargetGroupId;
        /// <summary>
        /// Target group VPC ID.
        /// </summary>
        public readonly string? TargetGroupName;
        /// <summary>
        /// Name of target group.
        /// </summary>
        public readonly string? VpcId;

        [OutputConstructor]
        private GetTargetGroupsResult(
            string id,

            ImmutableArray<Outputs.GetTargetGroupsListResult> lists,

            string? resultOutputFile,

            string? targetGroupId,

            string? targetGroupName,

            string? vpcId)
        {
            Id = id;
            Lists = lists;
            ResultOutputFile = resultOutputFile;
            TargetGroupId = targetGroupId;
            TargetGroupName = targetGroupName;
            VpcId = vpcId;
        }
    }
}
