// *** 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.Teo
{
    /// <summary>
    /// Provides a resource to create a teo application_proxy_rule
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var applicationProxyRule = new Tencentcloud.Teo.ApplicationProxyRule("applicationProxyRule", new Tencentcloud.Teo.ApplicationProxyRuleArgs
    ///         {
    ///             ForwardClientIp = "TOA",
    ///             OriginPort = "8083",
    ///             OriginType = "custom",
    ///             OriginValues = 
    ///             {
    ///                 "127.0.0.1",
    ///             },
    ///             Ports = 
    ///             {
    ///                 "8083",
    ///             },
    ///             Proto = "TCP",
    ///             ProxyId = "proxy-6972528a-373a-11ed-afca-52540044a456",
    ///             SessionPersist = false,
    ///             Status = "online",
    ///             ZoneId = "zone-2983wizgxqvm",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// teo application_proxy_rule can be imported using the zoneId#proxyId#ruleId, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Teo/applicationProxyRule:ApplicationProxyRule application_proxy_rule zone-2983wizgxqvm#proxy-6972528a-373a-11ed-afca-52540044a456#rule-90b13bb4-373a-11ed-8794-525400eddfed
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Teo/applicationProxyRule:ApplicationProxyRule")]
    public partial class ApplicationProxyRule : Pulumi.CustomResource
    {
        /// <summary>
        /// Passes the client IP. Default value is OFF.When Proto is TCP, valid values:- `TOA`: Pass the client IP via TOA.- `PPV1`: Pass the client IP via Proxy Protocol V1.- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.When Proto=UDP, valid values:- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.
        /// </summary>
        [Output("forwardClientIp")]
        public Output<string> ForwardClientIp { get; private set; } = null!;

        /// <summary>
        /// Origin port, supported formats: single port: 80; Port segment: 81-90, 81 to 90 ports.
        /// </summary>
        [Output("originPort")]
        public Output<string> OriginPort { get; private set; } = null!;

        /// <summary>
        /// Origin server type.- `custom`: Specified origins.- `origins`: An origin group.
        /// </summary>
        [Output("originType")]
        public Output<string> OriginType { get; private set; } = null!;

        /// <summary>
        /// Origin server information.When `OriginType` is custom, this field value indicates multiple origin servers in either of the following formats:- `IP`:Port- Domain name:Port.When `OriginType` is origins, it indicates the origin group ID.
        /// </summary>
        [Output("originValues")]
        public Output<ImmutableArray<string>> OriginValues { get; private set; } = null!;

        /// <summary>
        /// Valid values:- port number: `80` means port 80.- port range: `81-90` means port range 81-90.
        /// </summary>
        [Output("ports")]
        public Output<ImmutableArray<string>> Ports { get; private set; } = null!;

        /// <summary>
        /// Protocol. Valid values: `TCP`, `UDP`.
        /// </summary>
        [Output("proto")]
        public Output<string> Proto { get; private set; } = null!;

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

        /// <summary>
        /// Rule ID.
        /// </summary>
        [Output("ruleId")]
        public Output<string> RuleId { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable session persistence. Default value is false.
        /// </summary>
        [Output("sessionPersist")]
        public Output<bool> SessionPersist { get; private set; } = null!;

        /// <summary>
        /// Status of this application proxy rule. Valid values to set is `online` and `offline`.- `online`: Enable.- `offline`: Disable.- `progress`: Deploying.- `stopping`: Disabling.- `fail`: Deployment/Disabling failed.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// Site ID.
        /// </summary>
        [Output("zoneId")]
        public Output<string> ZoneId { get; private set; } = null!;


        /// <summary>
        /// Create a ApplicationProxyRule 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 ApplicationProxyRule(string name, ApplicationProxyRuleArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Teo/applicationProxyRule:ApplicationProxyRule", name, args ?? new ApplicationProxyRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ApplicationProxyRule(string name, Input<string> id, ApplicationProxyRuleState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Teo/applicationProxyRule:ApplicationProxyRule", 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/tencentcloudstack",
            };
            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 ApplicationProxyRule 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 ApplicationProxyRule Get(string name, Input<string> id, ApplicationProxyRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new ApplicationProxyRule(name, id, state, options);
        }
    }

    public sealed class ApplicationProxyRuleArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Passes the client IP. Default value is OFF.When Proto is TCP, valid values:- `TOA`: Pass the client IP via TOA.- `PPV1`: Pass the client IP via Proxy Protocol V1.- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.When Proto=UDP, valid values:- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.
        /// </summary>
        [Input("forwardClientIp")]
        public Input<string>? ForwardClientIp { get; set; }

        /// <summary>
        /// Origin port, supported formats: single port: 80; Port segment: 81-90, 81 to 90 ports.
        /// </summary>
        [Input("originPort", required: true)]
        public Input<string> OriginPort { get; set; } = null!;

        /// <summary>
        /// Origin server type.- `custom`: Specified origins.- `origins`: An origin group.
        /// </summary>
        [Input("originType", required: true)]
        public Input<string> OriginType { get; set; } = null!;

        [Input("originValues", required: true)]
        private InputList<string>? _originValues;

        /// <summary>
        /// Origin server information.When `OriginType` is custom, this field value indicates multiple origin servers in either of the following formats:- `IP`:Port- Domain name:Port.When `OriginType` is origins, it indicates the origin group ID.
        /// </summary>
        public InputList<string> OriginValues
        {
            get => _originValues ?? (_originValues = new InputList<string>());
            set => _originValues = value;
        }

        [Input("ports", required: true)]
        private InputList<string>? _ports;

        /// <summary>
        /// Valid values:- port number: `80` means port 80.- port range: `81-90` means port range 81-90.
        /// </summary>
        public InputList<string> Ports
        {
            get => _ports ?? (_ports = new InputList<string>());
            set => _ports = value;
        }

        /// <summary>
        /// Protocol. Valid values: `TCP`, `UDP`.
        /// </summary>
        [Input("proto", required: true)]
        public Input<string> Proto { get; set; } = null!;

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

        /// <summary>
        /// Specifies whether to enable session persistence. Default value is false.
        /// </summary>
        [Input("sessionPersist")]
        public Input<bool>? SessionPersist { get; set; }

        /// <summary>
        /// Status of this application proxy rule. Valid values to set is `online` and `offline`.- `online`: Enable.- `offline`: Disable.- `progress`: Deploying.- `stopping`: Disabling.- `fail`: Deployment/Disabling failed.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Site ID.
        /// </summary>
        [Input("zoneId", required: true)]
        public Input<string> ZoneId { get; set; } = null!;

        public ApplicationProxyRuleArgs()
        {
        }
    }

    public sealed class ApplicationProxyRuleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Passes the client IP. Default value is OFF.When Proto is TCP, valid values:- `TOA`: Pass the client IP via TOA.- `PPV1`: Pass the client IP via Proxy Protocol V1.- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.When Proto=UDP, valid values:- `PPV2`: Pass the client IP via Proxy Protocol V2.- `OFF`: Do not pass the client IP.
        /// </summary>
        [Input("forwardClientIp")]
        public Input<string>? ForwardClientIp { get; set; }

        /// <summary>
        /// Origin port, supported formats: single port: 80; Port segment: 81-90, 81 to 90 ports.
        /// </summary>
        [Input("originPort")]
        public Input<string>? OriginPort { get; set; }

        /// <summary>
        /// Origin server type.- `custom`: Specified origins.- `origins`: An origin group.
        /// </summary>
        [Input("originType")]
        public Input<string>? OriginType { get; set; }

        [Input("originValues")]
        private InputList<string>? _originValues;

        /// <summary>
        /// Origin server information.When `OriginType` is custom, this field value indicates multiple origin servers in either of the following formats:- `IP`:Port- Domain name:Port.When `OriginType` is origins, it indicates the origin group ID.
        /// </summary>
        public InputList<string> OriginValues
        {
            get => _originValues ?? (_originValues = new InputList<string>());
            set => _originValues = value;
        }

        [Input("ports")]
        private InputList<string>? _ports;

        /// <summary>
        /// Valid values:- port number: `80` means port 80.- port range: `81-90` means port range 81-90.
        /// </summary>
        public InputList<string> Ports
        {
            get => _ports ?? (_ports = new InputList<string>());
            set => _ports = value;
        }

        /// <summary>
        /// Protocol. Valid values: `TCP`, `UDP`.
        /// </summary>
        [Input("proto")]
        public Input<string>? Proto { get; set; }

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

        /// <summary>
        /// Rule ID.
        /// </summary>
        [Input("ruleId")]
        public Input<string>? RuleId { get; set; }

        /// <summary>
        /// Specifies whether to enable session persistence. Default value is false.
        /// </summary>
        [Input("sessionPersist")]
        public Input<bool>? SessionPersist { get; set; }

        /// <summary>
        /// Status of this application proxy rule. Valid values to set is `online` and `offline`.- `online`: Enable.- `offline`: Disable.- `progress`: Deploying.- `stopping`: Disabling.- `fail`: Deployment/Disabling failed.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Site ID.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        public ApplicationProxyRuleState()
        {
        }
    }
}
