<reponame>symbiosis-cloud/pulumi-symbiosis<filename>sdk/dotnet/Symbiosis/Cluster.cs// *** 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 Symbiosis.Pulumi.Symbiosis
{
    /// <summary>
    /// Manages Kubernetes clusters.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Symbiosis = Symbiosis.Pulumi.Symbiosis;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new Symbiosis.Cluster("example", new()
    ///     {
    ///         Region = "germany-1",
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [SymbiosisResourceType("symbiosis:index/cluster:Cluster")]
    public partial class Cluster : global::Pulumi.CustomResource
    {
        [Output("caCertificate")]
        public Output<string> CaCertificate { get; private set; } = null!;

        [Output("certificate")]
        public Output<string> Certificate { get; private set; } = null!;

        /// <summary>
        /// Cluster API server endpoint
        /// </summary>
        [Output("endpoint")]
        public Output<string> Endpoint { get; private set; } = null!;

        /// <summary>
        /// When set to true it will deploy a highly available control plane with multiple replicas for redundancy.
        /// </summary>
        [Output("isHighlyAvailable")]
        public Output<bool?> IsHighlyAvailable { get; private set; } = null!;

        /// <summary>
        /// Kubernetes version, see symbiosis.host for valid values or "latest" for the most recent supported version.
        /// </summary>
        [Output("kubeVersion")]
        public Output<string?> KubeVersion { get; private set; } = null!;

        /// <summary>
        /// The raw kubeconfig file.
        /// </summary>
        [Output("kubeconfig")]
        public Output<string> Kubeconfig { get; private set; } = null!;

        /// <summary>
        /// Cluster name. Changing the name forces re-creation.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        [Output("privateKey")]
        public Output<string> PrivateKey { get; private set; } = null!;

        [Output("region")]
        public Output<string> Region { get; private set; } = null!;


        /// <summary>
        /// Create a Cluster 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 Cluster(string name, ClusterArgs args, CustomResourceOptions? options = null)
            : base("symbiosis:index/cluster:Cluster", name, args ?? new ClusterArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Cluster(string name, Input<string> id, ClusterState? state = null, CustomResourceOptions? options = null)
            : base("symbiosis:index/cluster:Cluster", 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/symbiosis-cloud",
                AdditionalSecretOutputs =
                {
                    "caCertificate",
                    "certificate",
                    "kubeconfig",
                    "privateKey",
                },
            };
            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 Cluster 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 Cluster Get(string name, Input<string> id, ClusterState? state = null, CustomResourceOptions? options = null)
        {
            return new Cluster(name, id, state, options);
        }
    }

    public sealed class ClusterArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// When set to true it will deploy a highly available control plane with multiple replicas for redundancy.
        /// </summary>
        [Input("isHighlyAvailable")]
        public Input<bool>? IsHighlyAvailable { get; set; }

        /// <summary>
        /// Kubernetes version, see symbiosis.host for valid values or "latest" for the most recent supported version.
        /// </summary>
        [Input("kubeVersion")]
        public Input<string>? KubeVersion { get; set; }

        /// <summary>
        /// Cluster name. Changing the name forces re-creation.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("region", required: true)]
        public Input<string> Region { get; set; } = null!;

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

    public sealed class ClusterState : global::Pulumi.ResourceArgs
    {
        [Input("caCertificate")]
        private Input<string>? _caCertificate;
        public Input<string>? CaCertificate
        {
            get => _caCertificate;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _caCertificate = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        [Input("certificate")]
        private Input<string>? _certificate;
        public Input<string>? Certificate
        {
            get => _certificate;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _certificate = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Cluster API server endpoint
        /// </summary>
        [Input("endpoint")]
        public Input<string>? Endpoint { get; set; }

        /// <summary>
        /// When set to true it will deploy a highly available control plane with multiple replicas for redundancy.
        /// </summary>
        [Input("isHighlyAvailable")]
        public Input<bool>? IsHighlyAvailable { get; set; }

        /// <summary>
        /// Kubernetes version, see symbiosis.host for valid values or "latest" for the most recent supported version.
        /// </summary>
        [Input("kubeVersion")]
        public Input<string>? KubeVersion { get; set; }

        [Input("kubeconfig")]
        private Input<string>? _kubeconfig;

        /// <summary>
        /// The raw kubeconfig file.
        /// </summary>
        public Input<string>? Kubeconfig
        {
            get => _kubeconfig;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _kubeconfig = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Cluster name. Changing the name forces re-creation.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("privateKey")]
        private Input<string>? _privateKey;
        public Input<string>? PrivateKey
        {
            get => _privateKey;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _privateKey = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        [Input("region")]
        public Input<string>? Region { get; set; }

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