// *** 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.Flux
{
    /// <summary>
    /// Commits Flux components to a Git repository and configures a Kubernetes cluster to synchronize with the same Git repository.
    /// 
    /// &gt; **NOTE:** Checkout the GitHub bootstrap guide for a walkthrough over how to use this resource with GitHub.
    /// 
    /// &gt; **NOTE:** A breaking change in the attributes have been made in this resource. Read the guide for information of the changes required.
    /// 
    /// ## Example Usage
    /// 
    /// Get Kubernetes credentials from a kubeconfig file. The current context set in the kubeconfig file will be used by default.
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Flux = Pulumi.Flux;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var @this = new Flux.FluxBootstrapGit("this", new()
    ///     {
    ///         Path = "clusters/my-cluster",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Existing Flux installations can be imported by passing the namespace where Flux is installed.
    /// 
    /// ```sh
    ///  $ pulumi import flux:index/fluxBootstrapGit:FluxBootstrapGit this flux-system
    /// ```
    /// </summary>
    [FluxResourceType("flux:index/fluxBootstrapGit:FluxBootstrapGit")]
    public partial class FluxBootstrapGit : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The internal cluster domain. Defaults to `cluster.local`
        /// </summary>
        [Output("clusterDomain")]
        public Output<string> ClusterDomain { get; private set; } = null!;

        /// <summary>
        /// Toolkit components to include in the install manifests. Defaults to `[source-controller kustomize-controller helm-controller notification-controller]`
        /// </summary>
        [Output("components")]
        public Output<ImmutableArray<string>> Components { get; private set; } = null!;

        /// <summary>
        /// List of extra components to include in the install manifests.
        /// </summary>
        [Output("componentsExtras")]
        public Output<ImmutableArray<string>> ComponentsExtras { get; private set; } = null!;

        /// <summary>
        /// Kubernetes secret name used for pulling the toolkit images from a private registry.
        /// </summary>
        [Output("imagePullSecret")]
        public Output<string?> ImagePullSecret { get; private set; } = null!;

        /// <summary>
        /// Interval at which to reconcile from bootstrap repository. Defaults to `1m0s`.
        /// </summary>
        [Output("interval")]
        public Output<string> Interval { get; private set; } = null!;

        /// <summary>
        /// Kustomization to override configuration set by default.
        /// </summary>
        [Output("kustomizationOverride")]
        public Output<string?> KustomizationOverride { get; private set; } = null!;

        /// <summary>
        /// Log level for toolkit components. Defaults to `info`.
        /// </summary>
        [Output("logLevel")]
        public Output<string> LogLevel { get; private set; } = null!;

        /// <summary>
        /// The namespace scope for install manifests. Defaults to `flux-system`.
        /// </summary>
        [Output("namespace")]
        public Output<string> Namespace { get; private set; } = null!;

        /// <summary>
        /// Deny ingress access to the toolkit controllers from other namespaces using network policies. Defaults to `true`.
        /// </summary>
        [Output("networkPolicy")]
        public Output<bool> NetworkPolicy { get; private set; } = null!;

        /// <summary>
        /// Path relative to the repository root, when specified the cluster sync will be scoped to this path.
        /// </summary>
        [Output("path")]
        public Output<string?> Path { get; private set; } = null!;

        /// <summary>
        /// Configures the GitRepository source to initialize and include Git submodules in the artifact it produces.
        /// </summary>
        [Output("recurseSubmodules")]
        public Output<bool?> RecurseSubmodules { get; private set; } = null!;

        /// <summary>
        /// Container registry where the toolkit images are published. Defaults to `ghcr.io/fluxcd`.
        /// </summary>
        [Output("registry")]
        public Output<string> Registry { get; private set; } = null!;

        /// <summary>
        /// Git repository files created and managed by the provider.
        /// </summary>
        [Output("repositoryFiles")]
        public Output<ImmutableDictionary<string, string>> RepositoryFiles { get; private set; } = null!;

        /// <summary>
        /// Name of the secret the sync credentials can be found in or stored to. Defaults to `flux-system`.
        /// </summary>
        [Output("secretName")]
        public Output<string> SecretName { get; private set; } = null!;

        /// <summary>
        /// List of toleration keys used to schedule the components pods onto nodes with matching taints.
        /// </summary>
        [Output("tolerationKeys")]
        public Output<ImmutableArray<string>> TolerationKeys { get; private set; } = null!;

        /// <summary>
        /// Flux version. Defaults to `v0.41.2`.
        /// </summary>
        [Output("version")]
        public Output<string> Version { get; private set; } = null!;

        /// <summary>
        /// If true watch for custom resources in all namespaces. Defaults to `true`.
        /// </summary>
        [Output("watchAllNamespaces")]
        public Output<bool> WatchAllNamespaces { get; private set; } = null!;


        /// <summary>
        /// Create a FluxBootstrapGit 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 FluxBootstrapGit(string name, FluxBootstrapGitArgs? args = null, CustomResourceOptions? options = null)
            : base("flux:index/fluxBootstrapGit:FluxBootstrapGit", name, args ?? new FluxBootstrapGitArgs(), MakeResourceOptions(options, ""))
        {
        }

        private FluxBootstrapGit(string name, Input<string> id, FluxBootstrapGitState? state = null, CustomResourceOptions? options = null)
            : base("flux:index/fluxBootstrapGit:FluxBootstrapGit", 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/oun",
            };
            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 FluxBootstrapGit 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 FluxBootstrapGit Get(string name, Input<string> id, FluxBootstrapGitState? state = null, CustomResourceOptions? options = null)
        {
            return new FluxBootstrapGit(name, id, state, options);
        }
    }

    public sealed class FluxBootstrapGitArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The internal cluster domain. Defaults to `cluster.local`
        /// </summary>
        [Input("clusterDomain")]
        public Input<string>? ClusterDomain { get; set; }

        [Input("components")]
        private InputList<string>? _components;

        /// <summary>
        /// Toolkit components to include in the install manifests. Defaults to `[source-controller kustomize-controller helm-controller notification-controller]`
        /// </summary>
        public InputList<string> Components
        {
            get => _components ?? (_components = new InputList<string>());
            set => _components = value;
        }

        [Input("componentsExtras")]
        private InputList<string>? _componentsExtras;

        /// <summary>
        /// List of extra components to include in the install manifests.
        /// </summary>
        public InputList<string> ComponentsExtras
        {
            get => _componentsExtras ?? (_componentsExtras = new InputList<string>());
            set => _componentsExtras = value;
        }

        /// <summary>
        /// Kubernetes secret name used for pulling the toolkit images from a private registry.
        /// </summary>
        [Input("imagePullSecret")]
        public Input<string>? ImagePullSecret { get; set; }

        /// <summary>
        /// Interval at which to reconcile from bootstrap repository. Defaults to `1m0s`.
        /// </summary>
        [Input("interval")]
        public Input<string>? Interval { get; set; }

        /// <summary>
        /// Kustomization to override configuration set by default.
        /// </summary>
        [Input("kustomizationOverride")]
        public Input<string>? KustomizationOverride { get; set; }

        /// <summary>
        /// Log level for toolkit components. Defaults to `info`.
        /// </summary>
        [Input("logLevel")]
        public Input<string>? LogLevel { get; set; }

        /// <summary>
        /// The namespace scope for install manifests. Defaults to `flux-system`.
        /// </summary>
        [Input("namespace")]
        public Input<string>? Namespace { get; set; }

        /// <summary>
        /// Deny ingress access to the toolkit controllers from other namespaces using network policies. Defaults to `true`.
        /// </summary>
        [Input("networkPolicy")]
        public Input<bool>? NetworkPolicy { get; set; }

        /// <summary>
        /// Path relative to the repository root, when specified the cluster sync will be scoped to this path.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Configures the GitRepository source to initialize and include Git submodules in the artifact it produces.
        /// </summary>
        [Input("recurseSubmodules")]
        public Input<bool>? RecurseSubmodules { get; set; }

        /// <summary>
        /// Container registry where the toolkit images are published. Defaults to `ghcr.io/fluxcd`.
        /// </summary>
        [Input("registry")]
        public Input<string>? Registry { get; set; }

        /// <summary>
        /// Name of the secret the sync credentials can be found in or stored to. Defaults to `flux-system`.
        /// </summary>
        [Input("secretName")]
        public Input<string>? SecretName { get; set; }

        [Input("tolerationKeys")]
        private InputList<string>? _tolerationKeys;

        /// <summary>
        /// List of toleration keys used to schedule the components pods onto nodes with matching taints.
        /// </summary>
        public InputList<string> TolerationKeys
        {
            get => _tolerationKeys ?? (_tolerationKeys = new InputList<string>());
            set => _tolerationKeys = value;
        }

        /// <summary>
        /// Flux version. Defaults to `v0.41.2`.
        /// </summary>
        [Input("version")]
        public Input<string>? Version { get; set; }

        /// <summary>
        /// If true watch for custom resources in all namespaces. Defaults to `true`.
        /// </summary>
        [Input("watchAllNamespaces")]
        public Input<bool>? WatchAllNamespaces { get; set; }

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

    public sealed class FluxBootstrapGitState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The internal cluster domain. Defaults to `cluster.local`
        /// </summary>
        [Input("clusterDomain")]
        public Input<string>? ClusterDomain { get; set; }

        [Input("components")]
        private InputList<string>? _components;

        /// <summary>
        /// Toolkit components to include in the install manifests. Defaults to `[source-controller kustomize-controller helm-controller notification-controller]`
        /// </summary>
        public InputList<string> Components
        {
            get => _components ?? (_components = new InputList<string>());
            set => _components = value;
        }

        [Input("componentsExtras")]
        private InputList<string>? _componentsExtras;

        /// <summary>
        /// List of extra components to include in the install manifests.
        /// </summary>
        public InputList<string> ComponentsExtras
        {
            get => _componentsExtras ?? (_componentsExtras = new InputList<string>());
            set => _componentsExtras = value;
        }

        /// <summary>
        /// Kubernetes secret name used for pulling the toolkit images from a private registry.
        /// </summary>
        [Input("imagePullSecret")]
        public Input<string>? ImagePullSecret { get; set; }

        /// <summary>
        /// Interval at which to reconcile from bootstrap repository. Defaults to `1m0s`.
        /// </summary>
        [Input("interval")]
        public Input<string>? Interval { get; set; }

        /// <summary>
        /// Kustomization to override configuration set by default.
        /// </summary>
        [Input("kustomizationOverride")]
        public Input<string>? KustomizationOverride { get; set; }

        /// <summary>
        /// Log level for toolkit components. Defaults to `info`.
        /// </summary>
        [Input("logLevel")]
        public Input<string>? LogLevel { get; set; }

        /// <summary>
        /// The namespace scope for install manifests. Defaults to `flux-system`.
        /// </summary>
        [Input("namespace")]
        public Input<string>? Namespace { get; set; }

        /// <summary>
        /// Deny ingress access to the toolkit controllers from other namespaces using network policies. Defaults to `true`.
        /// </summary>
        [Input("networkPolicy")]
        public Input<bool>? NetworkPolicy { get; set; }

        /// <summary>
        /// Path relative to the repository root, when specified the cluster sync will be scoped to this path.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Configures the GitRepository source to initialize and include Git submodules in the artifact it produces.
        /// </summary>
        [Input("recurseSubmodules")]
        public Input<bool>? RecurseSubmodules { get; set; }

        /// <summary>
        /// Container registry where the toolkit images are published. Defaults to `ghcr.io/fluxcd`.
        /// </summary>
        [Input("registry")]
        public Input<string>? Registry { get; set; }

        [Input("repositoryFiles")]
        private InputMap<string>? _repositoryFiles;

        /// <summary>
        /// Git repository files created and managed by the provider.
        /// </summary>
        public InputMap<string> RepositoryFiles
        {
            get => _repositoryFiles ?? (_repositoryFiles = new InputMap<string>());
            set => _repositoryFiles = value;
        }

        /// <summary>
        /// Name of the secret the sync credentials can be found in or stored to. Defaults to `flux-system`.
        /// </summary>
        [Input("secretName")]
        public Input<string>? SecretName { get; set; }

        [Input("tolerationKeys")]
        private InputList<string>? _tolerationKeys;

        /// <summary>
        /// List of toleration keys used to schedule the components pods onto nodes with matching taints.
        /// </summary>
        public InputList<string> TolerationKeys
        {
            get => _tolerationKeys ?? (_tolerationKeys = new InputList<string>());
            set => _tolerationKeys = value;
        }

        /// <summary>
        /// Flux version. Defaults to `v0.41.2`.
        /// </summary>
        [Input("version")]
        public Input<string>? Version { get; set; }

        /// <summary>
        /// If true watch for custom resources in all namespaces. Defaults to `true`.
        /// </summary>
        [Input("watchAllNamespaces")]
        public Input<bool>? WatchAllNamespaces { get; set; }

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