<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.Tctest.Gaap
{
    [TctestResourceType("tctest:Gaap/layer4Listener:Layer4Listener")]
    public partial class Layer4Listener : Pulumi.CustomResource
    {
        /// <summary>
        /// The way the listener gets the client IP, 0 for TOA, 1 for Proxy Protocol, default value is 0. NOTES: Only supports
        /// listeners of `TCP` protocol.
        /// </summary>
        [Output("clientIpMethod")]
        public Output<int?> ClientIpMethod { get; private set; } = null!;

        /// <summary>
        /// Timeout of the health check response, should less than interval, default value is 2s. NOTES: Only supports listeners of
        /// `TCP` protocol and require less than `interval`.
        /// </summary>
        [Output("connectTimeout")]
        public Output<int?> ConnectTimeout { get; private set; } = null!;

        /// <summary>
        /// Creation time of the layer4 listener.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Indicates whether health check is enable, default value is `false`. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Output("healthCheck")]
        public Output<bool?> HealthCheck { get; private set; } = null!;

        /// <summary>
        /// Interval of the health check, default value is 5s. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Output("interval")]
        public Output<int?> Interval { get; private set; } = null!;

        /// <summary>
        /// Name of the layer4 listener, the maximum length is 30.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Port of the layer4 listener.
        /// </summary>
        [Output("port")]
        public Output<int> Port { get; private set; } = null!;

        /// <summary>
        /// Protocol of the layer4 listener. Valid value: `TCP` and `UDP`.
        /// </summary>
        [Output("protocol")]
        public Output<string> Protocol { get; private set; } = null!;

        /// <summary>
        /// ID of the GAAP proxy.
        /// </summary>
        [Output("proxyId")]
        public Output<string> ProxyId { get; private set; } = null!;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        [Output("realserverBindSets")]
        public Output<ImmutableArray<Outputs.Layer4ListenerRealserverBindSet>> RealserverBindSets { get; private set; } = null!;

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`. NOTES: when the `protocol` is specified as `TCP` and the
        /// `scheduler` is specified as `wrr`, the item can only be set to `IP`.
        /// </summary>
        [Output("realserverType")]
        public Output<string> RealserverType { get; private set; } = null!;

        /// <summary>
        /// Scheduling policy of the layer4 listener, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Output("scheduler")]
        public Output<string?> Scheduler { get; private set; } = null!;

        /// <summary>
        /// Status of the layer4 listener.
        /// </summary>
        [Output("status")]
        public Output<int> Status { get; private set; } = null!;


        /// <summary>
        /// Create a Layer4Listener 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 Layer4Listener(string name, Layer4ListenerArgs args, CustomResourceOptions? options = null)
            : base("tctest:Gaap/layer4Listener:Layer4Listener", name, args ?? new Layer4ListenerArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Layer4Listener(string name, Input<string> id, Layer4ListenerState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Gaap/layer4Listener:Layer4Listener", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 Layer4Listener 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 Layer4Listener Get(string name, Input<string> id, Layer4ListenerState? state = null, CustomResourceOptions? options = null)
        {
            return new Layer4Listener(name, id, state, options);
        }
    }

    public sealed class Layer4ListenerArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The way the listener gets the client IP, 0 for TOA, 1 for Proxy Protocol, default value is 0. NOTES: Only supports
        /// listeners of `TCP` protocol.
        /// </summary>
        [Input("clientIpMethod")]
        public Input<int>? ClientIpMethod { get; set; }

        /// <summary>
        /// Timeout of the health check response, should less than interval, default value is 2s. NOTES: Only supports listeners of
        /// `TCP` protocol and require less than `interval`.
        /// </summary>
        [Input("connectTimeout")]
        public Input<int>? ConnectTimeout { get; set; }

        /// <summary>
        /// Indicates whether health check is enable, default value is `false`. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Input("healthCheck")]
        public Input<bool>? HealthCheck { get; set; }

        /// <summary>
        /// Interval of the health check, default value is 5s. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Input("interval")]
        public Input<int>? Interval { get; set; }

        /// <summary>
        /// Name of the layer4 listener, the maximum length is 30.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Port of the layer4 listener.
        /// </summary>
        [Input("port", required: true)]
        public Input<int> Port { get; set; } = null!;

        /// <summary>
        /// Protocol of the layer4 listener. Valid value: `TCP` and `UDP`.
        /// </summary>
        [Input("protocol", required: true)]
        public Input<string> Protocol { get; set; } = null!;

        /// <summary>
        /// ID of the GAAP proxy.
        /// </summary>
        [Input("proxyId", required: true)]
        public Input<string> ProxyId { get; set; } = null!;

        [Input("realserverBindSets")]
        private InputList<Inputs.Layer4ListenerRealserverBindSetArgs>? _realserverBindSets;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        public InputList<Inputs.Layer4ListenerRealserverBindSetArgs> RealserverBindSets
        {
            get => _realserverBindSets ?? (_realserverBindSets = new InputList<Inputs.Layer4ListenerRealserverBindSetArgs>());
            set => _realserverBindSets = value;
        }

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`. NOTES: when the `protocol` is specified as `TCP` and the
        /// `scheduler` is specified as `wrr`, the item can only be set to `IP`.
        /// </summary>
        [Input("realserverType", required: true)]
        public Input<string> RealserverType { get; set; } = null!;

        /// <summary>
        /// Scheduling policy of the layer4 listener, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        public Layer4ListenerArgs()
        {
        }
    }

    public sealed class Layer4ListenerState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The way the listener gets the client IP, 0 for TOA, 1 for Proxy Protocol, default value is 0. NOTES: Only supports
        /// listeners of `TCP` protocol.
        /// </summary>
        [Input("clientIpMethod")]
        public Input<int>? ClientIpMethod { get; set; }

        /// <summary>
        /// Timeout of the health check response, should less than interval, default value is 2s. NOTES: Only supports listeners of
        /// `TCP` protocol and require less than `interval`.
        /// </summary>
        [Input("connectTimeout")]
        public Input<int>? ConnectTimeout { get; set; }

        /// <summary>
        /// Creation time of the layer4 listener.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Indicates whether health check is enable, default value is `false`. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Input("healthCheck")]
        public Input<bool>? HealthCheck { get; set; }

        /// <summary>
        /// Interval of the health check, default value is 5s. NOTES: Only supports listeners of `TCP` protocol.
        /// </summary>
        [Input("interval")]
        public Input<int>? Interval { get; set; }

        /// <summary>
        /// Name of the layer4 listener, the maximum length is 30.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Port of the layer4 listener.
        /// </summary>
        [Input("port")]
        public Input<int>? Port { get; set; }

        /// <summary>
        /// Protocol of the layer4 listener. Valid value: `TCP` and `UDP`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        /// <summary>
        /// ID of the GAAP proxy.
        /// </summary>
        [Input("proxyId")]
        public Input<string>? ProxyId { get; set; }

        [Input("realserverBindSets")]
        private InputList<Inputs.Layer4ListenerRealserverBindSetGetArgs>? _realserverBindSets;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        public InputList<Inputs.Layer4ListenerRealserverBindSetGetArgs> RealserverBindSets
        {
            get => _realserverBindSets ?? (_realserverBindSets = new InputList<Inputs.Layer4ListenerRealserverBindSetGetArgs>());
            set => _realserverBindSets = value;
        }

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`. NOTES: when the `protocol` is specified as `TCP` and the
        /// `scheduler` is specified as `wrr`, the item can only be set to `IP`.
        /// </summary>
        [Input("realserverType")]
        public Input<string>? RealserverType { get; set; }

        /// <summary>
        /// Scheduling policy of the layer4 listener, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// Status of the layer4 listener.
        /// </summary>
        [Input("status")]
        public Input<int>? Status { get; set; }

        public Layer4ListenerState()
        {
        }
    }
}
