// *** 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 zscaler.PulumiPackage.Zpa.ProvisioningKey
{
    /// <summary>
    /// ## Import
    /// 
    /// Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. [Visit](https://github.com/zscaler/zscaler-terraformer) Provisioning key can be imported by using `&lt;PROVISIONING KEY ID&gt;` or `&lt;PROVISIONING KEY NAME&gt;` as the import ID. For example
    /// 
    /// ```sh
    ///  $ pulumi import zpa:ProvisioningKey/provisioningKey:ProvisioningKey example &lt;provisioning_key_id&gt;
    /// ```
    /// 
    ///  or
    /// 
    /// ```sh
    ///  $ pulumi import zpa:ProvisioningKey/provisioningKey:ProvisioningKey example &lt;provisioning_key_name&gt;
    /// ```
    /// </summary>
    [ZpaResourceType("zpa:ProvisioningKey/provisioningKey:ProvisioningKey")]
    public partial class ProvisioningKey : global::Pulumi.CustomResource
    {
        [Output("appConnectorGroupId")]
        public Output<string?> AppConnectorGroupId { get; private set; } = null!;

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Output("appConnectorGroupName")]
        public Output<string> AppConnectorGroupName { get; private set; } = null!;

        /// <summary>
        /// Specifies the provisioning key type for App Connectors or ZPA Private Service Edges. The supported values are `CONNECTOR_GRP` and `SERVICE_EDGE_GRP`
        /// </summary>
        [Output("associationType")]
        public Output<string> AssociationType { get; private set; } = null!;

        /// <summary>
        /// Whether the provisioning key is enabled or not. Supported values: true, false
        /// </summary>
        [Output("enabled")]
        public Output<bool?> Enabled { get; private set; } = null!;

        /// <summary>
        /// ID of the enrollment certificate that can be used for this provisioning key. `ID` of the existing enrollment certificate that has the private key
        /// </summary>
        [Output("enrollmentCertId")]
        public Output<string> EnrollmentCertId { get; private set; } = null!;

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Output("enrollmentCertName")]
        public Output<string> EnrollmentCertName { get; private set; } = null!;

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

        /// <summary>
        /// read only field. Ignored in PUT/POST calls.
        /// </summary>
        [Output("key")]
        public Output<string> Key { get; private set; } = null!;

        /// <summary>
        /// The maximum number of instances where this provisioning key can be used for enrolling an App Connector or Service Edge.
        /// </summary>
        [Output("maxUsage")]
        public Output<string> MaxUsage { get; private set; } = null!;

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

        [Output("uiConfig")]
        public Output<string?> UiConfig { get; private set; } = null!;

        /// <summary>
        /// The provisioning key utilization count.
        /// </summary>
        [Output("usageCount")]
        public Output<string> UsageCount { get; private set; } = null!;

        /// <summary>
        /// ID of the existing App Connector or Service Edge Group.
        /// </summary>
        [Output("zcomponentId")]
        public Output<string> ZcomponentId { get; private set; } = null!;

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Output("zcomponentName")]
        public Output<string> ZcomponentName { get; private set; } = null!;


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

        private ProvisioningKey(string name, Input<string> id, ProvisioningKeyState? state = null, CustomResourceOptions? options = null)
            : base("zpa:ProvisioningKey/provisioningKey:ProvisioningKey", 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/zscaler",
                AdditionalSecretOutputs =
                {
                    "key",
                },
            };
            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 ProvisioningKey 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 ProvisioningKey Get(string name, Input<string> id, ProvisioningKeyState? state = null, CustomResourceOptions? options = null)
        {
            return new ProvisioningKey(name, id, state, options);
        }
    }

    public sealed class ProvisioningKeyArgs : global::Pulumi.ResourceArgs
    {
        [Input("appConnectorGroupId")]
        public Input<string>? AppConnectorGroupId { get; set; }

        /// <summary>
        /// Specifies the provisioning key type for App Connectors or ZPA Private Service Edges. The supported values are `CONNECTOR_GRP` and `SERVICE_EDGE_GRP`
        /// </summary>
        [Input("associationType", required: true)]
        public Input<string> AssociationType { get; set; } = null!;

        /// <summary>
        /// Whether the provisioning key is enabled or not. Supported values: true, false
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        /// <summary>
        /// ID of the enrollment certificate that can be used for this provisioning key. `ID` of the existing enrollment certificate that has the private key
        /// </summary>
        [Input("enrollmentCertId", required: true)]
        public Input<string> EnrollmentCertId { get; set; } = null!;

        [Input("ipAcls")]
        private InputList<string>? _ipAcls;
        public InputList<string> IpAcls
        {
            get => _ipAcls ?? (_ipAcls = new InputList<string>());
            set => _ipAcls = value;
        }

        /// <summary>
        /// The maximum number of instances where this provisioning key can be used for enrolling an App Connector or Service Edge.
        /// </summary>
        [Input("maxUsage", required: true)]
        public Input<string> MaxUsage { get; set; } = null!;

        /// <summary>
        /// Name of the provisioning key.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

        /// <summary>
        /// The provisioning key utilization count.
        /// </summary>
        [Input("usageCount")]
        public Input<string>? UsageCount { get; set; }

        /// <summary>
        /// ID of the existing App Connector or Service Edge Group.
        /// </summary>
        [Input("zcomponentId", required: true)]
        public Input<string> ZcomponentId { get; set; } = null!;

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Input("zcomponentName")]
        public Input<string>? ZcomponentName { get; set; }

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

    public sealed class ProvisioningKeyState : global::Pulumi.ResourceArgs
    {
        [Input("appConnectorGroupId")]
        public Input<string>? AppConnectorGroupId { get; set; }

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Input("appConnectorGroupName")]
        public Input<string>? AppConnectorGroupName { get; set; }

        /// <summary>
        /// Specifies the provisioning key type for App Connectors or ZPA Private Service Edges. The supported values are `CONNECTOR_GRP` and `SERVICE_EDGE_GRP`
        /// </summary>
        [Input("associationType")]
        public Input<string>? AssociationType { get; set; }

        /// <summary>
        /// Whether the provisioning key is enabled or not. Supported values: true, false
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        /// <summary>
        /// ID of the enrollment certificate that can be used for this provisioning key. `ID` of the existing enrollment certificate that has the private key
        /// </summary>
        [Input("enrollmentCertId")]
        public Input<string>? EnrollmentCertId { get; set; }

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Input("enrollmentCertName")]
        public Input<string>? EnrollmentCertName { get; set; }

        [Input("ipAcls")]
        private InputList<string>? _ipAcls;
        public InputList<string> IpAcls
        {
            get => _ipAcls ?? (_ipAcls = new InputList<string>());
            set => _ipAcls = value;
        }

        [Input("key")]
        private Input<string>? _key;

        /// <summary>
        /// read only field. Ignored in PUT/POST calls.
        /// </summary>
        public Input<string>? Key
        {
            get => _key;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _key = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// The maximum number of instances where this provisioning key can be used for enrolling an App Connector or Service Edge.
        /// </summary>
        [Input("maxUsage")]
        public Input<string>? MaxUsage { get; set; }

        /// <summary>
        /// Name of the provisioning key.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

        /// <summary>
        /// The provisioning key utilization count.
        /// </summary>
        [Input("usageCount")]
        public Input<string>? UsageCount { get; set; }

        /// <summary>
        /// ID of the existing App Connector or Service Edge Group.
        /// </summary>
        [Input("zcomponentId")]
        public Input<string>? ZcomponentId { get; set; }

        /// <summary>
        /// Read only property. Applicable only for GET calls, ignored in PUT/POST calls.
        /// </summary>
        [Input("zcomponentName")]
        public Input<string>? ZcomponentName { get; set; }

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