<reponame>pulumiverse/pulumi-fortios// *** 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 Pulumiverse.Fortios
{
    /// <summary>
    /// Configure Authentication Rules.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Fortios = Pulumiverse.Fortios;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var trname = new Fortios.AuthenticationRule("trname", new()
    ///     {
    ///         IpBased = "enable",
    ///         Protocol = "ftp",
    ///         Status = "enable",
    ///         TransactionBased = "disable",
    ///         WebAuthCookie = "disable",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Authentication Rule can be imported using any of these accepted formats
    /// 
    /// ```sh
    ///  $ pulumi import fortios:index/authenticationRule:AuthenticationRule labelname {{name}}
    /// ```
    /// 
    ///  If you do not want to import arguments of block$ export "FORTIOS_IMPORT_TABLE"="false"
    /// 
    /// ```sh
    ///  $ pulumi import fortios:index/authenticationRule:AuthenticationRule labelname {{name}}
    /// ```
    /// 
    ///  $ unset "FORTIOS_IMPORT_TABLE"
    /// </summary>
    [FortiosResourceType("fortios:index/authenticationRule:AuthenticationRule")]
    public partial class AuthenticationRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Select an active authentication method.
        /// </summary>
        [Output("activeAuthMethod")]
        public Output<string> ActiveAuthMethod { get; private set; } = null!;

        /// <summary>
        /// Comment.
        /// </summary>
        [Output("comments")]
        public Output<string?> Comments { get; private set; } = null!;

        /// <summary>
        /// Select an IPv6 destination address from available options. Required for web proxy authentication. The structure of `dstaddr6` block is documented below.
        /// </summary>
        [Output("dstaddr6s")]
        public Output<ImmutableArray<Outputs.AuthenticationRuleDstaddr6>> Dstaddr6s { get; private set; } = null!;

        /// <summary>
        /// Select an IPv4 destination address from available options. Required for web proxy authentication. The structure of `dstaddr` block is documented below.
        /// </summary>
        [Output("dstaddrs")]
        public Output<ImmutableArray<Outputs.AuthenticationRuleDstaddr>> Dstaddrs { get; private set; } = null!;

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Output("dynamicSortSubtable")]
        public Output<string?> DynamicSortSubtable { get; private set; } = null!;

        /// <summary>
        /// Enable/disable IP-based authentication. Once a user authenticates all traffic from the IP address the user authenticated from is allowed. Valid values: `enable`, `disable`.
        /// </summary>
        [Output("ipBased")]
        public Output<string> IpBased { get; private set; } = null!;

        /// <summary>
        /// Authentication rule name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Select the protocol to use for authentication (default = http). Users connect to the FortiGate using this protocol and are asked to authenticate. Valid values: `http`, `ftp`, `socks`, `ssh`.
        /// </summary>
        [Output("protocol")]
        public Output<string> Protocol { get; private set; } = null!;

        /// <summary>
        /// Select an IPv6 source address. Required for web proxy authentication. The structure of `srcaddr6` block is documented below.
        /// </summary>
        [Output("srcaddr6s")]
        public Output<ImmutableArray<Outputs.AuthenticationRuleSrcaddr6>> Srcaddr6s { get; private set; } = null!;

        /// <summary>
        /// Select an IPv4 source address from available options. Required for web proxy authentication. The structure of `srcaddr` block is documented below.
        /// </summary>
        [Output("srcaddrs")]
        public Output<ImmutableArray<Outputs.AuthenticationRuleSrcaddr>> Srcaddrs { get; private set; } = null!;

        /// <summary>
        /// Incoming (ingress) interface. The structure of `srcintf` block is documented below.
        /// </summary>
        [Output("srcintfs")]
        public Output<ImmutableArray<Outputs.AuthenticationRuleSrcintf>> Srcintfs { get; private set; } = null!;

        /// <summary>
        /// Select a single-sign on (SSO) authentication method.
        /// </summary>
        [Output("ssoAuthMethod")]
        public Output<string> SsoAuthMethod { get; private set; } = null!;

        /// <summary>
        /// Enable/disable this authentication rule. Valid values: `enable`, `disable`.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// Enable/disable transaction based authentication (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Output("transactionBased")]
        public Output<string> TransactionBased { get; private set; } = null!;

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Output("vdomparam")]
        public Output<string?> Vdomparam { get; private set; } = null!;

        /// <summary>
        /// Enable/disable Web authentication cookies (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Output("webAuthCookie")]
        public Output<string> WebAuthCookie { get; private set; } = null!;

        /// <summary>
        /// Enable/disable web portal for proxy transparent policy (default = enable). Valid values: `enable`, `disable`.
        /// </summary>
        [Output("webPortal")]
        public Output<string> WebPortal { get; private set; } = null!;


        /// <summary>
        /// Create a AuthenticationRule 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 AuthenticationRule(string name, AuthenticationRuleArgs? args = null, CustomResourceOptions? options = null)
            : base("fortios:index/authenticationRule:AuthenticationRule", name, args ?? new AuthenticationRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AuthenticationRule(string name, Input<string> id, AuthenticationRuleState? state = null, CustomResourceOptions? options = null)
            : base("fortios:index/authenticationRule:AuthenticationRule", 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/pulumiverse/pulumi-fortios",
            };
            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 AuthenticationRule 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 AuthenticationRule Get(string name, Input<string> id, AuthenticationRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new AuthenticationRule(name, id, state, options);
        }
    }

    public sealed class AuthenticationRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Select an active authentication method.
        /// </summary>
        [Input("activeAuthMethod")]
        public Input<string>? ActiveAuthMethod { get; set; }

        /// <summary>
        /// Comment.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        [Input("dstaddr6s")]
        private InputList<Inputs.AuthenticationRuleDstaddr6Args>? _dstaddr6s;

        /// <summary>
        /// Select an IPv6 destination address from available options. Required for web proxy authentication. The structure of `dstaddr6` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleDstaddr6Args> Dstaddr6s
        {
            get => _dstaddr6s ?? (_dstaddr6s = new InputList<Inputs.AuthenticationRuleDstaddr6Args>());
            set => _dstaddr6s = value;
        }

        [Input("dstaddrs")]
        private InputList<Inputs.AuthenticationRuleDstaddrArgs>? _dstaddrs;

        /// <summary>
        /// Select an IPv4 destination address from available options. Required for web proxy authentication. The structure of `dstaddr` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleDstaddrArgs> Dstaddrs
        {
            get => _dstaddrs ?? (_dstaddrs = new InputList<Inputs.AuthenticationRuleDstaddrArgs>());
            set => _dstaddrs = value;
        }

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Input("dynamicSortSubtable")]
        public Input<string>? DynamicSortSubtable { get; set; }

        /// <summary>
        /// Enable/disable IP-based authentication. Once a user authenticates all traffic from the IP address the user authenticated from is allowed. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("ipBased")]
        public Input<string>? IpBased { get; set; }

        /// <summary>
        /// Authentication rule name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Select the protocol to use for authentication (default = http). Users connect to the FortiGate using this protocol and are asked to authenticate. Valid values: `http`, `ftp`, `socks`, `ssh`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        [Input("srcaddr6s")]
        private InputList<Inputs.AuthenticationRuleSrcaddr6Args>? _srcaddr6s;

        /// <summary>
        /// Select an IPv6 source address. Required for web proxy authentication. The structure of `srcaddr6` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcaddr6Args> Srcaddr6s
        {
            get => _srcaddr6s ?? (_srcaddr6s = new InputList<Inputs.AuthenticationRuleSrcaddr6Args>());
            set => _srcaddr6s = value;
        }

        [Input("srcaddrs")]
        private InputList<Inputs.AuthenticationRuleSrcaddrArgs>? _srcaddrs;

        /// <summary>
        /// Select an IPv4 source address from available options. Required for web proxy authentication. The structure of `srcaddr` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcaddrArgs> Srcaddrs
        {
            get => _srcaddrs ?? (_srcaddrs = new InputList<Inputs.AuthenticationRuleSrcaddrArgs>());
            set => _srcaddrs = value;
        }

        [Input("srcintfs")]
        private InputList<Inputs.AuthenticationRuleSrcintfArgs>? _srcintfs;

        /// <summary>
        /// Incoming (ingress) interface. The structure of `srcintf` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcintfArgs> Srcintfs
        {
            get => _srcintfs ?? (_srcintfs = new InputList<Inputs.AuthenticationRuleSrcintfArgs>());
            set => _srcintfs = value;
        }

        /// <summary>
        /// Select a single-sign on (SSO) authentication method.
        /// </summary>
        [Input("ssoAuthMethod")]
        public Input<string>? SsoAuthMethod { get; set; }

        /// <summary>
        /// Enable/disable this authentication rule. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Enable/disable transaction based authentication (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("transactionBased")]
        public Input<string>? TransactionBased { get; set; }

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Input("vdomparam")]
        public Input<string>? Vdomparam { get; set; }

        /// <summary>
        /// Enable/disable Web authentication cookies (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("webAuthCookie")]
        public Input<string>? WebAuthCookie { get; set; }

        /// <summary>
        /// Enable/disable web portal for proxy transparent policy (default = enable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("webPortal")]
        public Input<string>? WebPortal { get; set; }

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

    public sealed class AuthenticationRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Select an active authentication method.
        /// </summary>
        [Input("activeAuthMethod")]
        public Input<string>? ActiveAuthMethod { get; set; }

        /// <summary>
        /// Comment.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        [Input("dstaddr6s")]
        private InputList<Inputs.AuthenticationRuleDstaddr6GetArgs>? _dstaddr6s;

        /// <summary>
        /// Select an IPv6 destination address from available options. Required for web proxy authentication. The structure of `dstaddr6` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleDstaddr6GetArgs> Dstaddr6s
        {
            get => _dstaddr6s ?? (_dstaddr6s = new InputList<Inputs.AuthenticationRuleDstaddr6GetArgs>());
            set => _dstaddr6s = value;
        }

        [Input("dstaddrs")]
        private InputList<Inputs.AuthenticationRuleDstaddrGetArgs>? _dstaddrs;

        /// <summary>
        /// Select an IPv4 destination address from available options. Required for web proxy authentication. The structure of `dstaddr` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleDstaddrGetArgs> Dstaddrs
        {
            get => _dstaddrs ?? (_dstaddrs = new InputList<Inputs.AuthenticationRuleDstaddrGetArgs>());
            set => _dstaddrs = value;
        }

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Input("dynamicSortSubtable")]
        public Input<string>? DynamicSortSubtable { get; set; }

        /// <summary>
        /// Enable/disable IP-based authentication. Once a user authenticates all traffic from the IP address the user authenticated from is allowed. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("ipBased")]
        public Input<string>? IpBased { get; set; }

        /// <summary>
        /// Authentication rule name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Select the protocol to use for authentication (default = http). Users connect to the FortiGate using this protocol and are asked to authenticate. Valid values: `http`, `ftp`, `socks`, `ssh`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        [Input("srcaddr6s")]
        private InputList<Inputs.AuthenticationRuleSrcaddr6GetArgs>? _srcaddr6s;

        /// <summary>
        /// Select an IPv6 source address. Required for web proxy authentication. The structure of `srcaddr6` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcaddr6GetArgs> Srcaddr6s
        {
            get => _srcaddr6s ?? (_srcaddr6s = new InputList<Inputs.AuthenticationRuleSrcaddr6GetArgs>());
            set => _srcaddr6s = value;
        }

        [Input("srcaddrs")]
        private InputList<Inputs.AuthenticationRuleSrcaddrGetArgs>? _srcaddrs;

        /// <summary>
        /// Select an IPv4 source address from available options. Required for web proxy authentication. The structure of `srcaddr` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcaddrGetArgs> Srcaddrs
        {
            get => _srcaddrs ?? (_srcaddrs = new InputList<Inputs.AuthenticationRuleSrcaddrGetArgs>());
            set => _srcaddrs = value;
        }

        [Input("srcintfs")]
        private InputList<Inputs.AuthenticationRuleSrcintfGetArgs>? _srcintfs;

        /// <summary>
        /// Incoming (ingress) interface. The structure of `srcintf` block is documented below.
        /// </summary>
        public InputList<Inputs.AuthenticationRuleSrcintfGetArgs> Srcintfs
        {
            get => _srcintfs ?? (_srcintfs = new InputList<Inputs.AuthenticationRuleSrcintfGetArgs>());
            set => _srcintfs = value;
        }

        /// <summary>
        /// Select a single-sign on (SSO) authentication method.
        /// </summary>
        [Input("ssoAuthMethod")]
        public Input<string>? SsoAuthMethod { get; set; }

        /// <summary>
        /// Enable/disable this authentication rule. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Enable/disable transaction based authentication (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("transactionBased")]
        public Input<string>? TransactionBased { get; set; }

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Input("vdomparam")]
        public Input<string>? Vdomparam { get; set; }

        /// <summary>
        /// Enable/disable Web authentication cookies (default = disable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("webAuthCookie")]
        public Input<string>? WebAuthCookie { get; set; }

        /// <summary>
        /// Enable/disable web portal for proxy transparent policy (default = enable). Valid values: `enable`, `disable`.
        /// </summary>
        [Input("webPortal")]
        public Input<string>? WebPortal { get; set; }

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