<reponame>yzpocket/WebProject// *** 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 PiersKarsenbarg.Octopusdeploy
{
    /// <summary>
    /// This resource manages certificates in Octopus Deploy.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Octopusdeploy = PiersKarsenbarg.Octopusdeploy;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new Octopusdeploy.Certificate("example", new()
    ///     {
    ///         CertificateData = "a-base-64-encoded-string-representing-the-certificate-data",
    ///         Password = "###########",
    ///     });
    /// 
    ///     // required; get from secure environment/store
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import octopusdeploy:index/certificate:Certificate [options] octopusdeploy_certificate.&lt;name&gt; &lt;certificate-id&gt;
    /// ```
    /// </summary>
    [OctopusdeployResourceType("octopusdeploy:index/certificate:Certificate")]
    public partial class Certificate : global::Pulumi.CustomResource
    {
        [Output("archived")]
        public Output<string> Archived { get; private set; } = null!;

        /// <summary>
        /// The encoded data of the certificate.
        /// </summary>
        [Output("certificateData")]
        public Output<string> CertificateData { get; private set; } = null!;

        /// <summary>
        /// Specifies the archive file format used for storing cryptography objects in the certificate. Valid formats are `Der`, `Pem`, `Pkcs12`, or `Unknown`.
        /// </summary>
        [Output("certificateDataFormat")]
        public Output<string> CertificateDataFormat { get; private set; } = null!;

        /// <summary>
        /// A list of environment IDs associated with this resource.
        /// </summary>
        [Output("environments")]
        public Output<ImmutableArray<string>> Environments { get; private set; } = null!;

        /// <summary>
        /// Indicates if the certificate has a private key.
        /// </summary>
        [Output("hasPrivateKey")]
        public Output<bool> HasPrivateKey { get; private set; } = null!;

        /// <summary>
        /// Indicates if the certificate has expired.
        /// </summary>
        [Output("isExpired")]
        public Output<bool> IsExpired { get; private set; } = null!;

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

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

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

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

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

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

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

        /// <summary>
        /// The password associated with this resource.
        /// </summary>
        [Output("password")]
        public Output<string> Password { get; private set; } = null!;

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

        [Output("selfSigned")]
        public Output<bool> SelfSigned { get; private set; } = null!;

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

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

        [Output("subjectAlternativeNames")]
        public Output<ImmutableArray<string>> SubjectAlternativeNames { get; private set; } = null!;

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

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

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

        /// <summary>
        /// A list of tenant tags associated with this resource.
        /// </summary>
        [Output("tenantTags")]
        public Output<ImmutableArray<string>> TenantTags { get; private set; } = null!;

        /// <summary>
        /// The tenanted deployment mode of the resource. Valid account types are `Untenanted`, `TenantedOrUntenanted`, or `Tenanted`.
        /// </summary>
        [Output("tenantedDeploymentParticipation")]
        public Output<string> TenantedDeploymentParticipation { get; private set; } = null!;

        /// <summary>
        /// A list of tenant IDs associated with this resource.
        /// </summary>
        [Output("tenants")]
        public Output<ImmutableArray<string>> Tenants { get; private set; } = null!;

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

        [Output("version")]
        public Output<int> Version { get; private set; } = null!;


        /// <summary>
        /// Create a Certificate 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 Certificate(string name, CertificateArgs args, CustomResourceOptions? options = null)
            : base("octopusdeploy:index/certificate:Certificate", name, args ?? new CertificateArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Certificate(string name, Input<string> id, CertificateState? state = null, CustomResourceOptions? options = null)
            : base("octopusdeploy:index/certificate:Certificate", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                AdditionalSecretOutputs =
                {
                    "certificateData",
                    "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;
        }
        /// <summary>
        /// Get an existing Certificate 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 Certificate Get(string name, Input<string> id, CertificateState? state = null, CustomResourceOptions? options = null)
        {
            return new Certificate(name, id, state, options);
        }
    }

    public sealed class CertificateArgs : global::Pulumi.ResourceArgs
    {
        [Input("archived")]
        public Input<string>? Archived { get; set; }

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

        /// <summary>
        /// The encoded data of the certificate.
        /// </summary>
        public Input<string>? CertificateData
        {
            get => _certificateData;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _certificateData = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Specifies the archive file format used for storing cryptography objects in the certificate. Valid formats are `Der`, `Pem`, `Pkcs12`, or `Unknown`.
        /// </summary>
        [Input("certificateDataFormat")]
        public Input<string>? CertificateDataFormat { get; set; }

        [Input("environments")]
        private InputList<string>? _environments;

        /// <summary>
        /// A list of environment IDs associated with this resource.
        /// </summary>
        public InputList<string> Environments
        {
            get => _environments ?? (_environments = new InputList<string>());
            set => _environments = value;
        }

        /// <summary>
        /// Indicates if the certificate has a private key.
        /// </summary>
        [Input("hasPrivateKey")]
        public Input<bool>? HasPrivateKey { get; set; }

        /// <summary>
        /// Indicates if the certificate has expired.
        /// </summary>
        [Input("isExpired")]
        public Input<bool>? IsExpired { get; set; }

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

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

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

        /// <summary>
        /// The name of this resource.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

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

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

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

        /// <summary>
        /// The password associated with this resource.
        /// </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);
            }
        }

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

        [Input("selfSigned")]
        public Input<bool>? SelfSigned { get; set; }

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

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

        [Input("subjectAlternativeNames")]
        private InputList<string>? _subjectAlternativeNames;
        public InputList<string> SubjectAlternativeNames
        {
            get => _subjectAlternativeNames ?? (_subjectAlternativeNames = new InputList<string>());
            set => _subjectAlternativeNames = value;
        }

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

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

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

        [Input("tenantTags")]
        private InputList<string>? _tenantTags;

        /// <summary>
        /// A list of tenant tags associated with this resource.
        /// </summary>
        public InputList<string> TenantTags
        {
            get => _tenantTags ?? (_tenantTags = new InputList<string>());
            set => _tenantTags = value;
        }

        /// <summary>
        /// The tenanted deployment mode of the resource. Valid account types are `Untenanted`, `TenantedOrUntenanted`, or `Tenanted`.
        /// </summary>
        [Input("tenantedDeploymentParticipation")]
        public Input<string>? TenantedDeploymentParticipation { get; set; }

        [Input("tenants")]
        private InputList<string>? _tenants;

        /// <summary>
        /// A list of tenant IDs associated with this resource.
        /// </summary>
        public InputList<string> Tenants
        {
            get => _tenants ?? (_tenants = new InputList<string>());
            set => _tenants = value;
        }

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

        [Input("version")]
        public Input<int>? Version { get; set; }

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

    public sealed class CertificateState : global::Pulumi.ResourceArgs
    {
        [Input("archived")]
        public Input<string>? Archived { get; set; }

        [Input("certificateData")]
        private Input<string>? _certificateData;

        /// <summary>
        /// The encoded data of the certificate.
        /// </summary>
        public Input<string>? CertificateData
        {
            get => _certificateData;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _certificateData = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Specifies the archive file format used for storing cryptography objects in the certificate. Valid formats are `Der`, `Pem`, `Pkcs12`, or `Unknown`.
        /// </summary>
        [Input("certificateDataFormat")]
        public Input<string>? CertificateDataFormat { get; set; }

        [Input("environments")]
        private InputList<string>? _environments;

        /// <summary>
        /// A list of environment IDs associated with this resource.
        /// </summary>
        public InputList<string> Environments
        {
            get => _environments ?? (_environments = new InputList<string>());
            set => _environments = value;
        }

        /// <summary>
        /// Indicates if the certificate has a private key.
        /// </summary>
        [Input("hasPrivateKey")]
        public Input<bool>? HasPrivateKey { get; set; }

        /// <summary>
        /// Indicates if the certificate has expired.
        /// </summary>
        [Input("isExpired")]
        public Input<bool>? IsExpired { get; set; }

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

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

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

        /// <summary>
        /// The name of this resource.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

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

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

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

        /// <summary>
        /// The password associated with this resource.
        /// </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);
            }
        }

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

        [Input("selfSigned")]
        public Input<bool>? SelfSigned { get; set; }

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

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

        [Input("subjectAlternativeNames")]
        private InputList<string>? _subjectAlternativeNames;
        public InputList<string> SubjectAlternativeNames
        {
            get => _subjectAlternativeNames ?? (_subjectAlternativeNames = new InputList<string>());
            set => _subjectAlternativeNames = value;
        }

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

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

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

        [Input("tenantTags")]
        private InputList<string>? _tenantTags;

        /// <summary>
        /// A list of tenant tags associated with this resource.
        /// </summary>
        public InputList<string> TenantTags
        {
            get => _tenantTags ?? (_tenantTags = new InputList<string>());
            set => _tenantTags = value;
        }

        /// <summary>
        /// The tenanted deployment mode of the resource. Valid account types are `Untenanted`, `TenantedOrUntenanted`, or `Tenanted`.
        /// </summary>
        [Input("tenantedDeploymentParticipation")]
        public Input<string>? TenantedDeploymentParticipation { get; set; }

        [Input("tenants")]
        private InputList<string>? _tenants;

        /// <summary>
        /// A list of tenant IDs associated with this resource.
        /// </summary>
        public InputList<string> Tenants
        {
            get => _tenants ?? (_tenants = new InputList<string>());
            set => _tenants = value;
        }

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

        [Input("version")]
        public Input<int>? Version { get; set; }

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