// *** 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.Tctest.Kms
{
    [TctestResourceType("tctest:Kms/kmsKey:KmsKey")]
    public partial class KmsKey : Pulumi.CustomResource
    {
        /// <summary>
        /// Name of CMK. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be
        /// a letter or number.
        /// </summary>
        [Output("alias")]
        public Output<string> Alias { get; private set; } = null!;

        /// <summary>
        /// Description of CMK. The maximum is 1024 bytes.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// Specify whether to archive key. Default value is `false`. This field is conflict with `is_enabled`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Output("isArchived")]
        public Output<bool?> IsArchived { get; private set; } = null!;

        /// <summary>
        /// Specify whether to enable key. Default value is `false`. This field is conflict with `is_archived`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Output("isEnabled")]
        public Output<bool?> IsEnabled { get; private set; } = null!;

        /// <summary>
        /// Specify whether to enable key rotation, valid when key_usage is `ENCRYPT_DECRYPT`. Default value is `false`.
        /// </summary>
        [Output("keyRotationEnabled")]
        public Output<bool?> KeyRotationEnabled { get; private set; } = null!;

        /// <summary>
        /// State of CMK.
        /// </summary>
        [Output("keyState")]
        public Output<string> KeyState { get; private set; } = null!;

        /// <summary>
        /// Usage of CMK. Available values include `ENCRYPT_DECRYPT`, `ASYMMETRIC_DECRYPT_RSA_2048`, `ASYMMETRIC_DECRYPT_SM2`,
        /// `ASYMMETRIC_SIGN_VERIFY_SM2`, `ASYMMETRIC_SIGN_VERIFY_RSA_2048`, `ASYMMETRIC_SIGN_VERIFY_ECC`. Default value is
        /// `ENCRYPT_DECRYPT`.
        /// </summary>
        [Output("keyUsage")]
        public Output<string?> KeyUsage { get; private set; } = null!;

        /// <summary>
        /// Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days.
        /// Defaults to 7 days.
        /// </summary>
        [Output("pendingDeleteWindowInDays")]
        public Output<int?> PendingDeleteWindowInDays { get; private set; } = null!;

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


        /// <summary>
        /// Create a KmsKey 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 KmsKey(string name, KmsKeyArgs args, CustomResourceOptions? options = null)
            : base("tctest:Kms/kmsKey:KmsKey", name, args ?? new KmsKeyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private KmsKey(string name, Input<string> id, KmsKeyState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Kms/kmsKey:KmsKey", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 KmsKey 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 KmsKey Get(string name, Input<string> id, KmsKeyState? state = null, CustomResourceOptions? options = null)
        {
            return new KmsKey(name, id, state, options);
        }
    }

    public sealed class KmsKeyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name of CMK. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be
        /// a letter or number.
        /// </summary>
        [Input("alias", required: true)]
        public Input<string> Alias { get; set; } = null!;

        /// <summary>
        /// Description of CMK. The maximum is 1024 bytes.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specify whether to archive key. Default value is `false`. This field is conflict with `is_enabled`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Input("isArchived")]
        public Input<bool>? IsArchived { get; set; }

        /// <summary>
        /// Specify whether to enable key. Default value is `false`. This field is conflict with `is_archived`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Input("isEnabled")]
        public Input<bool>? IsEnabled { get; set; }

        /// <summary>
        /// Specify whether to enable key rotation, valid when key_usage is `ENCRYPT_DECRYPT`. Default value is `false`.
        /// </summary>
        [Input("keyRotationEnabled")]
        public Input<bool>? KeyRotationEnabled { get; set; }

        /// <summary>
        /// Usage of CMK. Available values include `ENCRYPT_DECRYPT`, `ASYMMETRIC_DECRYPT_RSA_2048`, `ASYMMETRIC_DECRYPT_SM2`,
        /// `ASYMMETRIC_SIGN_VERIFY_SM2`, `ASYMMETRIC_SIGN_VERIFY_RSA_2048`, `ASYMMETRIC_SIGN_VERIFY_ECC`. Default value is
        /// `ENCRYPT_DECRYPT`.
        /// </summary>
        [Input("keyUsage")]
        public Input<string>? KeyUsage { get; set; }

        /// <summary>
        /// Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days.
        /// Defaults to 7 days.
        /// </summary>
        [Input("pendingDeleteWindowInDays")]
        public Input<int>? PendingDeleteWindowInDays { get; set; }

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

        /// <summary>
        /// Tags of CMK.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public KmsKeyArgs()
        {
        }
    }

    public sealed class KmsKeyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name of CMK. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be
        /// a letter or number.
        /// </summary>
        [Input("alias")]
        public Input<string>? Alias { get; set; }

        /// <summary>
        /// Description of CMK. The maximum is 1024 bytes.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specify whether to archive key. Default value is `false`. This field is conflict with `is_enabled`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Input("isArchived")]
        public Input<bool>? IsArchived { get; set; }

        /// <summary>
        /// Specify whether to enable key. Default value is `false`. This field is conflict with `is_archived`, valid when key_state
        /// is `Enabled`, `Disabled`, `Archived`.
        /// </summary>
        [Input("isEnabled")]
        public Input<bool>? IsEnabled { get; set; }

        /// <summary>
        /// Specify whether to enable key rotation, valid when key_usage is `ENCRYPT_DECRYPT`. Default value is `false`.
        /// </summary>
        [Input("keyRotationEnabled")]
        public Input<bool>? KeyRotationEnabled { get; set; }

        /// <summary>
        /// State of CMK.
        /// </summary>
        [Input("keyState")]
        public Input<string>? KeyState { get; set; }

        /// <summary>
        /// Usage of CMK. Available values include `ENCRYPT_DECRYPT`, `ASYMMETRIC_DECRYPT_RSA_2048`, `ASYMMETRIC_DECRYPT_SM2`,
        /// `ASYMMETRIC_SIGN_VERIFY_SM2`, `ASYMMETRIC_SIGN_VERIFY_RSA_2048`, `ASYMMETRIC_SIGN_VERIFY_ECC`. Default value is
        /// `ENCRYPT_DECRYPT`.
        /// </summary>
        [Input("keyUsage")]
        public Input<string>? KeyUsage { get; set; }

        /// <summary>
        /// Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days.
        /// Defaults to 7 days.
        /// </summary>
        [Input("pendingDeleteWindowInDays")]
        public Input<int>? PendingDeleteWindowInDays { get; set; }

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

        /// <summary>
        /// Tags of CMK.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public KmsKeyState()
        {
        }
    }
}
