<reponame>mrhamburg/pulumi-provider-routeros// *** 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.Routeros
{
    /// <summary>
    /// The provider type for the routeros package. By default, resources use package-wide configuration
    /// settings, however an explicit `Provider` instance may be created and passed during resource
    /// construction to achieve fine-grained programmatic control over provider settings. See the
    /// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
    /// </summary>
    [RouterosResourceType("pulumi:providers:routeros")]
    public partial class Provider : global::Pulumi.ProviderResource
    {
        /// <summary>
        /// Path to MikroTik's certificate authority file.
        /// </summary>
        [Output("caCertificate")]
        public Output<string?> CaCertificate { get; private set; } = null!;

        /// <summary>
        /// URL of the MikroTik router, default is TLS connection to REST. * API: api[s]://host[:port] * api://router.local *
        /// apis://router.local:8729 * REST: https://host * https://router.local * router.local * 127.0.0.1 export
        /// ROS_HOSTURL=router.local or export MIKROTIK_HOST=router.local
        /// </summary>
        [Output("hosturl")]
        public Output<string?> Hosturl { get; private set; } = null!;

        /// <summary>
        /// Password for the MikroTik user.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        /// <summary>
        /// Username for the MikroTik WEB/Winbox. export ROS_USERNAME=admin or export MIKROTIK_USER=admin
        /// </summary>
        [Output("username")]
        public Output<string?> Username { get; private set; } = null!;


        /// <summary>
        /// Create a Provider 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 Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null)
            : base("routeros", name, args ?? new ProviderArgs(), MakeResourceOptions(options, ""))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                AdditionalSecretOutputs =
                {
                    "caCertificate",
                    "password",
                },
            };
            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;
        }
    }

    public sealed class ProviderArgs : global::Pulumi.ResourceArgs
    {
        [Input("caCertificate")]
        private Input<string>? _caCertificate;

        /// <summary>
        /// Path to MikroTik's certificate authority file.
        /// </summary>
        public Input<string>? CaCertificate
        {
            get => _caCertificate;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _caCertificate = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// URL of the MikroTik router, default is TLS connection to REST. * API: api[s]://host[:port] * api://router.local *
        /// apis://router.local:8729 * REST: https://host * https://router.local * router.local * 127.0.0.1 export
        /// ROS_HOSTURL=router.local or export MIKROTIK_HOST=router.local
        /// </summary>
        [Input("hosturl")]
        public Input<string>? Hosturl { get; set; }

        /// <summary>
        /// Whether to verify the SSL certificate or not.
        /// </summary>
        [Input("insecure", json: true)]
        public Input<bool>? Insecure { get; set; }

        [Input("password")]
        private Input<string>? _password;

        /// <summary>
        /// Password for the MikroTik user.
        /// </summary>
        public Input<string>? Password
        {
            get => _password;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Username for the MikroTik WEB/Winbox. export ROS_USERNAME=admin or export MIKROTIK_USER=admin
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

        public ProviderArgs()
        {
            CaCertificate = Utilities.GetEnv("ROS_CA_CERTIFICATE");
            Hosturl = Utilities.GetEnv("ROS_HOSTURL");
            Insecure = Utilities.GetEnvBoolean("ROS_INSECURE");
            Password = Utilities.GetEnv("ROS_PASSWORD");
            Username = Utilities.GetEnv("ROS_USERNAME");
        }
        public static new ProviderArgs Empty => new ProviderArgs();
    }
}
