<gh_stars>0// *** 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.Aviatrix
{
    /// <summary>
    /// The **aviatrix_gateway_certificate_config** resource allows the management of Aviatrix [gateway certificate](https://docs.aviatrix.com/HowTos/controller_certificate.html#gateway-certificate-management) configuration. Available as of provider version R2.18.1+.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.IO;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Aviatrix Gateway Certificate Management
    ///     var testGatewayCert = new Aviatrix.AviatrixGatewayCertificateConfig("testGatewayCert", new()
    ///     {
    ///         CaCertificate = File.ReadAllText("path/to/CA_cert.pem"),
    ///         CaPrivateKey = File.ReadAllText("path/to/CA_private.key"),
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// !&gt; **WARNING:** When importing, the provider cannot read your private key or certificate into the state file. After importing, if you do not want to change the values of the CA private key or certificate you must set the attributes `ca_certificate` and `ca_private_key` to the empty string (""). Otherwise, Terraform will see a diff and force replacement. `aviatrix_gateway_certificate_config` can be imported using controller IP with the dots(.) replaces with dashes(-), e.g. controller IP is 10.11.12.13
    /// 
    /// ```sh
    ///  $ pulumi import aviatrix:index/aviatrixGatewayCertificateConfig:AviatrixGatewayCertificateConfig test 10-11-12-13
    /// ```
    /// </summary>
    [AviatrixResourceType("aviatrix:index/aviatrixGatewayCertificateConfig:AviatrixGatewayCertificateConfig")]
    public partial class AviatrixGatewayCertificateConfig : global::Pulumi.CustomResource
    {
        /// <summary>
        /// CA Certificate in PEM format. To read certificate from a file please use the built-in `file` function.
        /// </summary>
        [Output("caCertificate")]
        public Output<string> CaCertificate { get; private set; } = null!;

        /// <summary>
        /// CA Private Key. To read the private key from a file please use the built-in `file` function.
        /// </summary>
        [Output("caPrivateKey")]
        public Output<string> CaPrivateKey { get; private set; } = null!;


        /// <summary>
        /// Create a AviatrixGatewayCertificateConfig 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 AviatrixGatewayCertificateConfig(string name, AviatrixGatewayCertificateConfigArgs args, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixGatewayCertificateConfig:AviatrixGatewayCertificateConfig", name, args ?? new AviatrixGatewayCertificateConfigArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AviatrixGatewayCertificateConfig(string name, Input<string> id, AviatrixGatewayCertificateConfigState? state = null, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixGatewayCertificateConfig:AviatrixGatewayCertificateConfig", 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/astipkovits",
                AdditionalSecretOutputs =
                {
                    "caPrivateKey",
                },
            };
            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 AviatrixGatewayCertificateConfig 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 AviatrixGatewayCertificateConfig Get(string name, Input<string> id, AviatrixGatewayCertificateConfigState? state = null, CustomResourceOptions? options = null)
        {
            return new AviatrixGatewayCertificateConfig(name, id, state, options);
        }
    }

    public sealed class AviatrixGatewayCertificateConfigArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// CA Certificate in PEM format. To read certificate from a file please use the built-in `file` function.
        /// </summary>
        [Input("caCertificate", required: true)]
        public Input<string> CaCertificate { get; set; } = null!;

        [Input("caPrivateKey", required: true)]
        private Input<string>? _caPrivateKey;

        /// <summary>
        /// CA Private Key. To read the private key from a file please use the built-in `file` function.
        /// </summary>
        public Input<string>? CaPrivateKey
        {
            get => _caPrivateKey;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _caPrivateKey = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

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

    public sealed class AviatrixGatewayCertificateConfigState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// CA Certificate in PEM format. To read certificate from a file please use the built-in `file` function.
        /// </summary>
        [Input("caCertificate")]
        public Input<string>? CaCertificate { get; set; }

        [Input("caPrivateKey")]
        private Input<string>? _caPrivateKey;

        /// <summary>
        /// CA Private Key. To read the private key from a file please use the built-in `file` function.
        /// </summary>
        public Input<string>? CaPrivateKey
        {
            get => _caPrivateKey;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _caPrivateKey = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

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