All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.kms.inputs.KeyState Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.alicloud.kms.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class KeyState extends com.pulumi.resources.ResourceArgs {

    public static final KeyState Empty = new KeyState();

    /**
     * The ARN of the key.
     * 
     */
    @Import(name="arn")
    private @Nullable Output arn;

    /**
     * @return The ARN of the key.
     * 
     */
    public Optional> arn() {
        return Optional.ofNullable(this.arn);
    }

    /**
     * Specifies whether to enable automatic key rotation. Default value: `Disabled`. Valid values: `Enabled`, `Disabled`.
     * 
     */
    @Import(name="automaticRotation")
    private @Nullable Output automaticRotation;

    /**
     * @return Specifies whether to enable automatic key rotation. Default value: `Disabled`. Valid values: `Enabled`, `Disabled`.
     * 
     */
    public Optional> automaticRotation() {
        return Optional.ofNullable(this.automaticRotation);
    }

    /**
     * The time when the CMK was created.
     * 
     */
    @Import(name="creationDate")
    private @Nullable Output creationDate;

    /**
     * @return The time when the CMK was created.
     * 
     */
    public Optional> creationDate() {
        return Optional.ofNullable(this.creationDate);
    }

    /**
     * The creator of the CMK.
     * 
     */
    @Import(name="creator")
    private @Nullable Output creator;

    /**
     * @return The creator of the CMK.
     * 
     */
    public Optional> creator() {
        return Optional.ofNullable(this.creator);
    }

    /**
     * The time at which the CMK is scheduled for deletion.
     * 
     */
    @Import(name="deleteDate")
    private @Nullable Output deleteDate;

    /**
     * @return The time at which the CMK is scheduled for deletion.
     * 
     */
    public Optional> deleteDate() {
        return Optional.ofNullable(this.deleteDate);
    }

    /**
     * Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
     * 
     * @deprecated
     * Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
     * 
     */
    @Deprecated /* Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead. */
    @Import(name="deletionWindowInDays")
    private @Nullable Output deletionWindowInDays;

    /**
     * @return Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
     * 
     * @deprecated
     * Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
     * 
     */
    @Deprecated /* Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead. */
    public Optional> deletionWindowInDays() {
        return Optional.ofNullable(this.deletionWindowInDays);
    }

    /**
     * The description of the key.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return The description of the key.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The ID of the KMS instance.
     * 
     */
    @Import(name="dkmsInstanceId")
    private @Nullable Output dkmsInstanceId;

    /**
     * @return The ID of the KMS instance.
     * 
     */
    public Optional> dkmsInstanceId() {
        return Optional.ofNullable(this.dkmsInstanceId);
    }

    /**
     * Field `is_enabled` has been deprecated from provider version 1.85.0. New field `status` instead.
     * 
     * > **NOTE:** If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
     * 
     * > **NOTE:** The default type of the CMK is `Aliyun_AES_256`. Only Dedicated KMS supports `Aliyun_AES_128` and `Aliyun_AES_192`.
     * 
     * > **NOTE:** When the pre-deletion days elapses, the key is permanently deleted and cannot be recovered.
     * 
     * @deprecated
     * Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
     * 
     */
    @Deprecated /* Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead. */
    @Import(name="isEnabled")
    private @Nullable Output isEnabled;

    /**
     * @return Field `is_enabled` has been deprecated from provider version 1.85.0. New field `status` instead.
     * 
     * > **NOTE:** If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
     * 
     * > **NOTE:** The default type of the CMK is `Aliyun_AES_256`. Only Dedicated KMS supports `Aliyun_AES_128` and `Aliyun_AES_192`.
     * 
     * > **NOTE:** When the pre-deletion days elapses, the key is permanently deleted and cannot be recovered.
     * 
     * @deprecated
     * Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
     * 
     */
    @Deprecated /* Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead. */
    public Optional> isEnabled() {
        return Optional.ofNullable(this.isEnabled);
    }

    /**
     * The specification of the key. Default value: `Aliyun_AES_256`. Valid values: `Aliyun_AES_256`, `Aliyun_AES_128`, `Aliyun_AES_192`, `Aliyun_SM4`, `RSA_2048`, `RSA_3072`, `EC_P256`, `EC_P256K`, `EC_SM2`.
     * 
     */
    @Import(name="keySpec")
    private @Nullable Output keySpec;

    /**
     * @return The specification of the key. Default value: `Aliyun_AES_256`. Valid values: `Aliyun_AES_256`, `Aliyun_AES_128`, `Aliyun_AES_192`, `Aliyun_SM4`, `RSA_2048`, `RSA_3072`, `EC_P256`, `EC_P256K`, `EC_SM2`.
     * 
     */
    public Optional> keySpec() {
        return Optional.ofNullable(this.keySpec);
    }

    /**
     * Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
     * 
     * @deprecated
     * Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
     * 
     */
    @Deprecated /* Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead. */
    @Import(name="keyState")
    private @Nullable Output keyState;

    /**
     * @return Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
     * 
     * @deprecated
     * Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
     * 
     */
    @Deprecated /* Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead. */
    public Optional> keyState() {
        return Optional.ofNullable(this.keyState);
    }

    /**
     * The usage of the key. Default value: `ENCRYPT/DECRYPT`. Valid values:
     * - `ENCRYPT/DECRYPT`: Encrypts or decrypts data.
     * - `SIGN/VERIFY`: Generates or verifies a digital signature.
     * 
     */
    @Import(name="keyUsage")
    private @Nullable Output keyUsage;

    /**
     * @return The usage of the key. Default value: `ENCRYPT/DECRYPT`. Valid values:
     * - `ENCRYPT/DECRYPT`: Encrypts or decrypts data.
     * - `SIGN/VERIFY`: Generates or verifies a digital signature.
     * 
     */
    public Optional> keyUsage() {
        return Optional.ofNullable(this.keyUsage);
    }

    /**
     * The time when the last rotation was performed.
     * 
     */
    @Import(name="lastRotationDate")
    private @Nullable Output lastRotationDate;

    /**
     * @return The time when the last rotation was performed.
     * 
     */
    public Optional> lastRotationDate() {
        return Optional.ofNullable(this.lastRotationDate);
    }

    /**
     * The time when the key material expires.
     * 
     */
    @Import(name="materialExpireTime")
    private @Nullable Output materialExpireTime;

    /**
     * @return The time when the key material expires.
     * 
     */
    public Optional> materialExpireTime() {
        return Optional.ofNullable(this.materialExpireTime);
    }

    /**
     * The time when the next rotation will be performed.
     * 
     */
    @Import(name="nextRotationDate")
    private @Nullable Output nextRotationDate;

    /**
     * @return The time when the next rotation will be performed.
     * 
     */
    public Optional> nextRotationDate() {
        return Optional.ofNullable(this.nextRotationDate);
    }

    /**
     * The key material origin. Default value: `Aliyun_KMS`. Valid values: `Aliyun_KMS`, `EXTERNAL`.
     * 
     */
    @Import(name="origin")
    private @Nullable Output origin;

    /**
     * @return The key material origin. Default value: `Aliyun_KMS`. Valid values: `Aliyun_KMS`, `EXTERNAL`.
     * 
     */
    public Optional> origin() {
        return Optional.ofNullable(this.origin);
    }

    /**
     * The number of days before the CMK is deleted. During this period, the CMK is in the PendingDeletion state. After this period ends, you cannot cancel the deletion. Unit: days. Valid values: `7` to `366`.
     * **NOTE:** From version 1.184.0, `pending_window_in_days` can be set to `366`.
     * 
     */
    @Import(name="pendingWindowInDays")
    private @Nullable Output pendingWindowInDays;

    /**
     * @return The number of days before the CMK is deleted. During this period, the CMK is in the PendingDeletion state. After this period ends, you cannot cancel the deletion. Unit: days. Valid values: `7` to `366`.
     * **NOTE:** From version 1.184.0, `pending_window_in_days` can be set to `366`.
     * 
     */
    public Optional> pendingWindowInDays() {
        return Optional.ofNullable(this.pendingWindowInDays);
    }

    /**
     * The content of the key policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see [How to use it](https://www.alibabacloud.com/help/en/kms/developer-reference/api-setkeypolicy).
     * 
     */
    @Import(name="policy")
    private @Nullable Output policy;

    /**
     * @return The content of the key policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see [How to use it](https://www.alibabacloud.com/help/en/kms/developer-reference/api-setkeypolicy).
     * 
     */
    public Optional> policy() {
        return Optional.ofNullable(this.policy);
    }

    /**
     * The ID of the current primary key version of the symmetric CMK.
     * 
     */
    @Import(name="primaryKeyVersion")
    private @Nullable Output primaryKeyVersion;

    /**
     * @return The ID of the current primary key version of the symmetric CMK.
     * 
     */
    public Optional> primaryKeyVersion() {
        return Optional.ofNullable(this.primaryKeyVersion);
    }

    /**
     * The protection level of the key. Default value: `SOFTWARE`. Valid values: `SOFTWARE`, `HSM`.
     * 
     */
    @Import(name="protectionLevel")
    private @Nullable Output protectionLevel;

    /**
     * @return The protection level of the key. Default value: `SOFTWARE`. Valid values: `SOFTWARE`, `HSM`.
     * 
     */
    public Optional> protectionLevel() {
        return Optional.ofNullable(this.protectionLevel);
    }

    /**
     * The period of automatic key rotation. The following units are supported: d (day), h (hour), m (minute), and s (second). For example, you can use either 7d or 604800s to specify a seven-day interval.
     * **NOTE**: If `automatic_rotation` is set to `Enabled`, `rotation_interval` is required.
     * 
     */
    @Import(name="rotationInterval")
    private @Nullable Output rotationInterval;

    /**
     * @return The period of automatic key rotation. The following units are supported: d (day), h (hour), m (minute), and s (second). For example, you can use either 7d or 604800s to specify a seven-day interval.
     * **NOTE**: If `automatic_rotation` is set to `Enabled`, `rotation_interval` is required.
     * 
     */
    public Optional> rotationInterval() {
        return Optional.ofNullable(this.rotationInterval);
    }

    /**
     * The status of key. Default value: `Enabled`. Valid values: `Enabled`, `Disabled`, `PendingDeletion`.
     * 
     */
    @Import(name="status")
    private @Nullable Output status;

    /**
     * @return The status of key. Default value: `Enabled`. Valid values: `Enabled`, `Disabled`, `PendingDeletion`.
     * 
     */
    public Optional> status() {
        return Optional.ofNullable(this.status);
    }

    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private KeyState() {}

    private KeyState(KeyState $) {
        this.arn = $.arn;
        this.automaticRotation = $.automaticRotation;
        this.creationDate = $.creationDate;
        this.creator = $.creator;
        this.deleteDate = $.deleteDate;
        this.deletionWindowInDays = $.deletionWindowInDays;
        this.description = $.description;
        this.dkmsInstanceId = $.dkmsInstanceId;
        this.isEnabled = $.isEnabled;
        this.keySpec = $.keySpec;
        this.keyState = $.keyState;
        this.keyUsage = $.keyUsage;
        this.lastRotationDate = $.lastRotationDate;
        this.materialExpireTime = $.materialExpireTime;
        this.nextRotationDate = $.nextRotationDate;
        this.origin = $.origin;
        this.pendingWindowInDays = $.pendingWindowInDays;
        this.policy = $.policy;
        this.primaryKeyVersion = $.primaryKeyVersion;
        this.protectionLevel = $.protectionLevel;
        this.rotationInterval = $.rotationInterval;
        this.status = $.status;
        this.tags = $.tags;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(KeyState defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private KeyState $;

        public Builder() {
            $ = new KeyState();
        }

        public Builder(KeyState defaults) {
            $ = new KeyState(Objects.requireNonNull(defaults));
        }

        /**
         * @param arn The ARN of the key.
         * 
         * @return builder
         * 
         */
        public Builder arn(@Nullable Output arn) {
            $.arn = arn;
            return this;
        }

        /**
         * @param arn The ARN of the key.
         * 
         * @return builder
         * 
         */
        public Builder arn(String arn) {
            return arn(Output.of(arn));
        }

        /**
         * @param automaticRotation Specifies whether to enable automatic key rotation. Default value: `Disabled`. Valid values: `Enabled`, `Disabled`.
         * 
         * @return builder
         * 
         */
        public Builder automaticRotation(@Nullable Output automaticRotation) {
            $.automaticRotation = automaticRotation;
            return this;
        }

        /**
         * @param automaticRotation Specifies whether to enable automatic key rotation. Default value: `Disabled`. Valid values: `Enabled`, `Disabled`.
         * 
         * @return builder
         * 
         */
        public Builder automaticRotation(String automaticRotation) {
            return automaticRotation(Output.of(automaticRotation));
        }

        /**
         * @param creationDate The time when the CMK was created.
         * 
         * @return builder
         * 
         */
        public Builder creationDate(@Nullable Output creationDate) {
            $.creationDate = creationDate;
            return this;
        }

        /**
         * @param creationDate The time when the CMK was created.
         * 
         * @return builder
         * 
         */
        public Builder creationDate(String creationDate) {
            return creationDate(Output.of(creationDate));
        }

        /**
         * @param creator The creator of the CMK.
         * 
         * @return builder
         * 
         */
        public Builder creator(@Nullable Output creator) {
            $.creator = creator;
            return this;
        }

        /**
         * @param creator The creator of the CMK.
         * 
         * @return builder
         * 
         */
        public Builder creator(String creator) {
            return creator(Output.of(creator));
        }

        /**
         * @param deleteDate The time at which the CMK is scheduled for deletion.
         * 
         * @return builder
         * 
         */
        public Builder deleteDate(@Nullable Output deleteDate) {
            $.deleteDate = deleteDate;
            return this;
        }

        /**
         * @param deleteDate The time at which the CMK is scheduled for deletion.
         * 
         * @return builder
         * 
         */
        public Builder deleteDate(String deleteDate) {
            return deleteDate(Output.of(deleteDate));
        }

        /**
         * @param deletionWindowInDays Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
         * 
         */
        @Deprecated /* Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead. */
        public Builder deletionWindowInDays(@Nullable Output deletionWindowInDays) {
            $.deletionWindowInDays = deletionWindowInDays;
            return this;
        }

        /**
         * @param deletionWindowInDays Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
         * 
         */
        @Deprecated /* Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead. */
        public Builder deletionWindowInDays(Integer deletionWindowInDays) {
            return deletionWindowInDays(Output.of(deletionWindowInDays));
        }

        /**
         * @param description The description of the key.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description The description of the key.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param dkmsInstanceId The ID of the KMS instance.
         * 
         * @return builder
         * 
         */
        public Builder dkmsInstanceId(@Nullable Output dkmsInstanceId) {
            $.dkmsInstanceId = dkmsInstanceId;
            return this;
        }

        /**
         * @param dkmsInstanceId The ID of the KMS instance.
         * 
         * @return builder
         * 
         */
        public Builder dkmsInstanceId(String dkmsInstanceId) {
            return dkmsInstanceId(Output.of(dkmsInstanceId));
        }

        /**
         * @param isEnabled Field `is_enabled` has been deprecated from provider version 1.85.0. New field `status` instead.
         * 
         * > **NOTE:** If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
         * 
         * > **NOTE:** The default type of the CMK is `Aliyun_AES_256`. Only Dedicated KMS supports `Aliyun_AES_128` and `Aliyun_AES_192`.
         * 
         * > **NOTE:** When the pre-deletion days elapses, the key is permanently deleted and cannot be recovered.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
         * 
         */
        @Deprecated /* Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead. */
        public Builder isEnabled(@Nullable Output isEnabled) {
            $.isEnabled = isEnabled;
            return this;
        }

        /**
         * @param isEnabled Field `is_enabled` has been deprecated from provider version 1.85.0. New field `status` instead.
         * 
         * > **NOTE:** If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
         * 
         * > **NOTE:** The default type of the CMK is `Aliyun_AES_256`. Only Dedicated KMS supports `Aliyun_AES_128` and `Aliyun_AES_192`.
         * 
         * > **NOTE:** When the pre-deletion days elapses, the key is permanently deleted and cannot be recovered.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
         * 
         */
        @Deprecated /* Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead. */
        public Builder isEnabled(Boolean isEnabled) {
            return isEnabled(Output.of(isEnabled));
        }

        /**
         * @param keySpec The specification of the key. Default value: `Aliyun_AES_256`. Valid values: `Aliyun_AES_256`, `Aliyun_AES_128`, `Aliyun_AES_192`, `Aliyun_SM4`, `RSA_2048`, `RSA_3072`, `EC_P256`, `EC_P256K`, `EC_SM2`.
         * 
         * @return builder
         * 
         */
        public Builder keySpec(@Nullable Output keySpec) {
            $.keySpec = keySpec;
            return this;
        }

        /**
         * @param keySpec The specification of the key. Default value: `Aliyun_AES_256`. Valid values: `Aliyun_AES_256`, `Aliyun_AES_128`, `Aliyun_AES_192`, `Aliyun_SM4`, `RSA_2048`, `RSA_3072`, `EC_P256`, `EC_P256K`, `EC_SM2`.
         * 
         * @return builder
         * 
         */
        public Builder keySpec(String keySpec) {
            return keySpec(Output.of(keySpec));
        }

        /**
         * @param keyState Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
         * 
         */
        @Deprecated /* Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead. */
        public Builder keyState(@Nullable Output keyState) {
            $.keyState = keyState;
            return this;
        }

        /**
         * @param keyState Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
         * 
         */
        @Deprecated /* Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead. */
        public Builder keyState(String keyState) {
            return keyState(Output.of(keyState));
        }

        /**
         * @param keyUsage The usage of the key. Default value: `ENCRYPT/DECRYPT`. Valid values:
         * - `ENCRYPT/DECRYPT`: Encrypts or decrypts data.
         * - `SIGN/VERIFY`: Generates or verifies a digital signature.
         * 
         * @return builder
         * 
         */
        public Builder keyUsage(@Nullable Output keyUsage) {
            $.keyUsage = keyUsage;
            return this;
        }

        /**
         * @param keyUsage The usage of the key. Default value: `ENCRYPT/DECRYPT`. Valid values:
         * - `ENCRYPT/DECRYPT`: Encrypts or decrypts data.
         * - `SIGN/VERIFY`: Generates or verifies a digital signature.
         * 
         * @return builder
         * 
         */
        public Builder keyUsage(String keyUsage) {
            return keyUsage(Output.of(keyUsage));
        }

        /**
         * @param lastRotationDate The time when the last rotation was performed.
         * 
         * @return builder
         * 
         */
        public Builder lastRotationDate(@Nullable Output lastRotationDate) {
            $.lastRotationDate = lastRotationDate;
            return this;
        }

        /**
         * @param lastRotationDate The time when the last rotation was performed.
         * 
         * @return builder
         * 
         */
        public Builder lastRotationDate(String lastRotationDate) {
            return lastRotationDate(Output.of(lastRotationDate));
        }

        /**
         * @param materialExpireTime The time when the key material expires.
         * 
         * @return builder
         * 
         */
        public Builder materialExpireTime(@Nullable Output materialExpireTime) {
            $.materialExpireTime = materialExpireTime;
            return this;
        }

        /**
         * @param materialExpireTime The time when the key material expires.
         * 
         * @return builder
         * 
         */
        public Builder materialExpireTime(String materialExpireTime) {
            return materialExpireTime(Output.of(materialExpireTime));
        }

        /**
         * @param nextRotationDate The time when the next rotation will be performed.
         * 
         * @return builder
         * 
         */
        public Builder nextRotationDate(@Nullable Output nextRotationDate) {
            $.nextRotationDate = nextRotationDate;
            return this;
        }

        /**
         * @param nextRotationDate The time when the next rotation will be performed.
         * 
         * @return builder
         * 
         */
        public Builder nextRotationDate(String nextRotationDate) {
            return nextRotationDate(Output.of(nextRotationDate));
        }

        /**
         * @param origin The key material origin. Default value: `Aliyun_KMS`. Valid values: `Aliyun_KMS`, `EXTERNAL`.
         * 
         * @return builder
         * 
         */
        public Builder origin(@Nullable Output origin) {
            $.origin = origin;
            return this;
        }

        /**
         * @param origin The key material origin. Default value: `Aliyun_KMS`. Valid values: `Aliyun_KMS`, `EXTERNAL`.
         * 
         * @return builder
         * 
         */
        public Builder origin(String origin) {
            return origin(Output.of(origin));
        }

        /**
         * @param pendingWindowInDays The number of days before the CMK is deleted. During this period, the CMK is in the PendingDeletion state. After this period ends, you cannot cancel the deletion. Unit: days. Valid values: `7` to `366`.
         * **NOTE:** From version 1.184.0, `pending_window_in_days` can be set to `366`.
         * 
         * @return builder
         * 
         */
        public Builder pendingWindowInDays(@Nullable Output pendingWindowInDays) {
            $.pendingWindowInDays = pendingWindowInDays;
            return this;
        }

        /**
         * @param pendingWindowInDays The number of days before the CMK is deleted. During this period, the CMK is in the PendingDeletion state. After this period ends, you cannot cancel the deletion. Unit: days. Valid values: `7` to `366`.
         * **NOTE:** From version 1.184.0, `pending_window_in_days` can be set to `366`.
         * 
         * @return builder
         * 
         */
        public Builder pendingWindowInDays(Integer pendingWindowInDays) {
            return pendingWindowInDays(Output.of(pendingWindowInDays));
        }

        /**
         * @param policy The content of the key policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see [How to use it](https://www.alibabacloud.com/help/en/kms/developer-reference/api-setkeypolicy).
         * 
         * @return builder
         * 
         */
        public Builder policy(@Nullable Output policy) {
            $.policy = policy;
            return this;
        }

        /**
         * @param policy The content of the key policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see [How to use it](https://www.alibabacloud.com/help/en/kms/developer-reference/api-setkeypolicy).
         * 
         * @return builder
         * 
         */
        public Builder policy(String policy) {
            return policy(Output.of(policy));
        }

        /**
         * @param primaryKeyVersion The ID of the current primary key version of the symmetric CMK.
         * 
         * @return builder
         * 
         */
        public Builder primaryKeyVersion(@Nullable Output primaryKeyVersion) {
            $.primaryKeyVersion = primaryKeyVersion;
            return this;
        }

        /**
         * @param primaryKeyVersion The ID of the current primary key version of the symmetric CMK.
         * 
         * @return builder
         * 
         */
        public Builder primaryKeyVersion(String primaryKeyVersion) {
            return primaryKeyVersion(Output.of(primaryKeyVersion));
        }

        /**
         * @param protectionLevel The protection level of the key. Default value: `SOFTWARE`. Valid values: `SOFTWARE`, `HSM`.
         * 
         * @return builder
         * 
         */
        public Builder protectionLevel(@Nullable Output protectionLevel) {
            $.protectionLevel = protectionLevel;
            return this;
        }

        /**
         * @param protectionLevel The protection level of the key. Default value: `SOFTWARE`. Valid values: `SOFTWARE`, `HSM`.
         * 
         * @return builder
         * 
         */
        public Builder protectionLevel(String protectionLevel) {
            return protectionLevel(Output.of(protectionLevel));
        }

        /**
         * @param rotationInterval The period of automatic key rotation. The following units are supported: d (day), h (hour), m (minute), and s (second). For example, you can use either 7d or 604800s to specify a seven-day interval.
         * **NOTE**: If `automatic_rotation` is set to `Enabled`, `rotation_interval` is required.
         * 
         * @return builder
         * 
         */
        public Builder rotationInterval(@Nullable Output rotationInterval) {
            $.rotationInterval = rotationInterval;
            return this;
        }

        /**
         * @param rotationInterval The period of automatic key rotation. The following units are supported: d (day), h (hour), m (minute), and s (second). For example, you can use either 7d or 604800s to specify a seven-day interval.
         * **NOTE**: If `automatic_rotation` is set to `Enabled`, `rotation_interval` is required.
         * 
         * @return builder
         * 
         */
        public Builder rotationInterval(String rotationInterval) {
            return rotationInterval(Output.of(rotationInterval));
        }

        /**
         * @param status The status of key. Default value: `Enabled`. Valid values: `Enabled`, `Disabled`, `PendingDeletion`.
         * 
         * @return builder
         * 
         */
        public Builder status(@Nullable Output status) {
            $.status = status;
            return this;
        }

        /**
         * @param status The status of key. Default value: `Enabled`. Valid values: `Enabled`, `Disabled`, `PendingDeletion`.
         * 
         * @return builder
         * 
         */
        public Builder status(String status) {
            return status(Output.of(status));
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        public KeyState build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy