// *** 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.AliCloud.Kms
{
    /// <summary>
    /// This resouce used to create a secret and store its initial version.
    /// 
    /// &gt; **NOTE:** Available in 1.76.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var @default = new AliCloud.Kms.Secret("default", new()
    ///     {
    ///         Description = "from terraform",
    ///         ForceDeleteWithoutRecovery = true,
    ///         SecretData = "Secret data.",
    ///         SecretName = "secret-foo",
    ///         VersionId = "000000000001",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// KMS secret can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:kms/secret:Secret default secret-foo
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:kms/secret:Secret")]
    public partial class Secret : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The Alicloud Resource Name (ARN) of the secret.
        /// </summary>
        [Output("arn")]
        public Output<string> Arn { get; private set; } = null!;

        /// <summary>
        /// The description of the secret.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The instance ID of the exclusive KMS instance.
        /// </summary>
        [Output("dkmsInstanceId")]
        public Output<string?> DkmsInstanceId { get; private set; } = null!;

        /// <summary>
        /// Whether to enable automatic key rotation.
        /// </summary>
        [Output("enableAutomaticRotation")]
        public Output<bool?> EnableAutomaticRotation { get; private set; } = null!;

        /// <summary>
        /// The ID of the KMS CMK that is used to encrypt the secret value. If you do not specify this parameter, Secrets Manager automatically creates an encryption key to encrypt the secret.
        /// </summary>
        [Output("encryptionKeyId")]
        public Output<string?> EncryptionKeyId { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to forcibly delete the secret. If this parameter is set to true, the secret cannot be recovered. Valid values: true, false. Default to: false.
        /// </summary>
        [Output("forceDeleteWithoutRecovery")]
        public Output<bool?> ForceDeleteWithoutRecovery { get; private set; } = null!;

        /// <summary>
        /// The time when the secret is scheduled to be deleted.
        /// </summary>
        [Output("plannedDeleteTime")]
        public Output<string> PlannedDeleteTime { get; private set; } = null!;

        /// <summary>
        /// Specifies the recovery period of the secret if you do not forcibly delete it. Default value: 30. It will be ignored when `force_delete_without_recovery` is true.
        /// </summary>
        [Output("recoveryWindowInDays")]
        public Output<int?> RecoveryWindowInDays { get; private set; } = null!;

        /// <summary>
        /// The time period of automatic rotation. The format is integer[unit], where integer represents the length of time, and unit represents the unit of time. The legal unit units are: d (day), h (hour), m (minute), s (second). 7d or 604800s both indicate a 7-day cycle.
        /// </summary>
        [Output("rotationInterval")]
        public Output<string?> RotationInterval { get; private set; } = null!;

        /// <summary>
        /// The value of the secret that you want to create. Secrets Manager encrypts the secret value and stores it in the initial version.
        /// </summary>
        [Output("secretData")]
        public Output<string> SecretData { get; private set; } = null!;

        /// <summary>
        /// The type of the secret value. Valid values: text, binary. Default to "text".
        /// </summary>
        [Output("secretDataType")]
        public Output<string?> SecretDataType { get; private set; } = null!;

        /// <summary>
        /// The name of the secret.
        /// </summary>
        [Output("secretName")]
        public Output<string> SecretName { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;

        /// <summary>
        /// The version number of the initial version. Version numbers are unique in each secret object.
        /// </summary>
        [Output("versionId")]
        public Output<string> VersionId { get; private set; } = null!;

        /// <summary>
        /// ) The stage labels that mark the new secret version. If you do not specify this parameter, Secrets Manager marks it with "ACSCurrent".
        /// </summary>
        [Output("versionStages")]
        public Output<ImmutableArray<string>> VersionStages { get; private set; } = null!;


        /// <summary>
        /// Create a Secret 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 Secret(string name, SecretArgs args, CustomResourceOptions? options = null)
            : base("alicloud:kms/secret:Secret", name, args ?? new SecretArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Secret(string name, Input<string> id, SecretState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:kms/secret:Secret", 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/rhysmdnz/pulumi-alicloud",
            };
            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 Secret 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 Secret Get(string name, Input<string> id, SecretState? state = null, CustomResourceOptions? options = null)
        {
            return new Secret(name, id, state, options);
        }
    }

    public sealed class SecretArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of the secret.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The instance ID of the exclusive KMS instance.
        /// </summary>
        [Input("dkmsInstanceId")]
        public Input<string>? DkmsInstanceId { get; set; }

        /// <summary>
        /// Whether to enable automatic key rotation.
        /// </summary>
        [Input("enableAutomaticRotation")]
        public Input<bool>? EnableAutomaticRotation { get; set; }

        /// <summary>
        /// The ID of the KMS CMK that is used to encrypt the secret value. If you do not specify this parameter, Secrets Manager automatically creates an encryption key to encrypt the secret.
        /// </summary>
        [Input("encryptionKeyId")]
        public Input<string>? EncryptionKeyId { get; set; }

        /// <summary>
        /// Specifies whether to forcibly delete the secret. If this parameter is set to true, the secret cannot be recovered. Valid values: true, false. Default to: false.
        /// </summary>
        [Input("forceDeleteWithoutRecovery")]
        public Input<bool>? ForceDeleteWithoutRecovery { get; set; }

        /// <summary>
        /// Specifies the recovery period of the secret if you do not forcibly delete it. Default value: 30. It will be ignored when `force_delete_without_recovery` is true.
        /// </summary>
        [Input("recoveryWindowInDays")]
        public Input<int>? RecoveryWindowInDays { get; set; }

        /// <summary>
        /// The time period of automatic rotation. The format is integer[unit], where integer represents the length of time, and unit represents the unit of time. The legal unit units are: d (day), h (hour), m (minute), s (second). 7d or 604800s both indicate a 7-day cycle.
        /// </summary>
        [Input("rotationInterval")]
        public Input<string>? RotationInterval { get; set; }

        /// <summary>
        /// The value of the secret that you want to create. Secrets Manager encrypts the secret value and stores it in the initial version.
        /// </summary>
        [Input("secretData", required: true)]
        public Input<string> SecretData { get; set; } = null!;

        /// <summary>
        /// The type of the secret value. Valid values: text, binary. Default to "text".
        /// </summary>
        [Input("secretDataType")]
        public Input<string>? SecretDataType { get; set; }

        /// <summary>
        /// The name of the secret.
        /// </summary>
        [Input("secretName", required: true)]
        public Input<string> SecretName { get; set; } = null!;

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// The version number of the initial version. Version numbers are unique in each secret object.
        /// </summary>
        [Input("versionId", required: true)]
        public Input<string> VersionId { get; set; } = null!;

        [Input("versionStages")]
        private InputList<string>? _versionStages;

        /// <summary>
        /// ) The stage labels that mark the new secret version. If you do not specify this parameter, Secrets Manager marks it with "ACSCurrent".
        /// </summary>
        public InputList<string> VersionStages
        {
            get => _versionStages ?? (_versionStages = new InputList<string>());
            set => _versionStages = value;
        }

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

    public sealed class SecretState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Alicloud Resource Name (ARN) of the secret.
        /// </summary>
        [Input("arn")]
        public Input<string>? Arn { get; set; }

        /// <summary>
        /// The description of the secret.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The instance ID of the exclusive KMS instance.
        /// </summary>
        [Input("dkmsInstanceId")]
        public Input<string>? DkmsInstanceId { get; set; }

        /// <summary>
        /// Whether to enable automatic key rotation.
        /// </summary>
        [Input("enableAutomaticRotation")]
        public Input<bool>? EnableAutomaticRotation { get; set; }

        /// <summary>
        /// The ID of the KMS CMK that is used to encrypt the secret value. If you do not specify this parameter, Secrets Manager automatically creates an encryption key to encrypt the secret.
        /// </summary>
        [Input("encryptionKeyId")]
        public Input<string>? EncryptionKeyId { get; set; }

        /// <summary>
        /// Specifies whether to forcibly delete the secret. If this parameter is set to true, the secret cannot be recovered. Valid values: true, false. Default to: false.
        /// </summary>
        [Input("forceDeleteWithoutRecovery")]
        public Input<bool>? ForceDeleteWithoutRecovery { get; set; }

        /// <summary>
        /// The time when the secret is scheduled to be deleted.
        /// </summary>
        [Input("plannedDeleteTime")]
        public Input<string>? PlannedDeleteTime { get; set; }

        /// <summary>
        /// Specifies the recovery period of the secret if you do not forcibly delete it. Default value: 30. It will be ignored when `force_delete_without_recovery` is true.
        /// </summary>
        [Input("recoveryWindowInDays")]
        public Input<int>? RecoveryWindowInDays { get; set; }

        /// <summary>
        /// The time period of automatic rotation. The format is integer[unit], where integer represents the length of time, and unit represents the unit of time. The legal unit units are: d (day), h (hour), m (minute), s (second). 7d or 604800s both indicate a 7-day cycle.
        /// </summary>
        [Input("rotationInterval")]
        public Input<string>? RotationInterval { get; set; }

        /// <summary>
        /// The value of the secret that you want to create. Secrets Manager encrypts the secret value and stores it in the initial version.
        /// </summary>
        [Input("secretData")]
        public Input<string>? SecretData { get; set; }

        /// <summary>
        /// The type of the secret value. Valid values: text, binary. Default to "text".
        /// </summary>
        [Input("secretDataType")]
        public Input<string>? SecretDataType { get; set; }

        /// <summary>
        /// The name of the secret.
        /// </summary>
        [Input("secretName")]
        public Input<string>? SecretName { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// The version number of the initial version. Version numbers are unique in each secret object.
        /// </summary>
        [Input("versionId")]
        public Input<string>? VersionId { get; set; }

        [Input("versionStages")]
        private InputList<string>? _versionStages;

        /// <summary>
        /// ) The stage labels that mark the new secret version. If you do not specify this parameter, Secrets Manager marks it with "ACSCurrent".
        /// </summary>
        public InputList<string> VersionStages
        {
            get => _versionStages ?? (_versionStages = new InputList<string>());
            set => _versionStages = value;
        }

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