@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
411 lines (410 loc) • 14.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a KMS key resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const keyAlias = config.requireObject("keyAlias");
* const test = new huaweicloud.dew.Key("test", {
* keyAlias: keyAlias,
* pendingDays: "7",
* });
* ```
*
* ## Import
*
* The KMS Key resource can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Dew/key:Key test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`pending_days` and `is_enabled`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also you can ignore changes as below. hcl resource "huaweicloud_kms_key" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* pending_days, is_enabled
*
* ]
*
* } }
*/
export declare class Key extends pulumi.CustomResource {
/**
* Get an existing Key resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: KeyState, opts?: pulumi.CustomResourceOptions): Key;
/**
* Returns true if the given object is an instance of Key. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Key;
/**
* The creation time of the KMS key.
* The value is a time stamp, e.g. **1723272402000**.
*/
readonly creationDate: pulumi.Output<string>;
/**
* The default master Key identifier.
* The value can be **1** (indicated the KMS key is default master key) or
* **0** (indicated the KMS key is not default master key).
*/
readonly defaultKeyFlag: pulumi.Output<string>;
/**
* The ID of the user account.
*/
readonly domainId: pulumi.Output<string>;
/**
* Specifies the enterprise project ID to which the KMS key belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* The expiration time of the KMS key material.
* The value is a time stamp, e.g. **1723272402000**.
*/
readonly expirationTime: pulumi.Output<string>;
/**
* Specifies whether the KMS key is enabled.
* The default value is **true**.
* This parameter is not supported when creating an external import key for the first time.
*/
readonly isEnabled: pulumi.Output<boolean | undefined>;
/**
* Specifies the generation algorithm of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **AES_256**. The valid values are as follows:
* + **AES_256**
* + **SM4**
* + **RSA_2048**
* + **RSA_3072**
* + **RSA_4096**
* + **EC_P256**
* + **EC_P384**
* + **SM2**
*/
readonly keyAlgorithm: pulumi.Output<string>;
/**
* Specifies the alias name of the KMS key.
* Only letters, digits, underscores(_), hyphens(-), colons(:) and slash(/) are allowed.
* The valid length is limited from `1` to `255` characters.
* The name must be different from the alias of the default master key.
*/
readonly keyAlias: pulumi.Output<string>;
/**
* Specifies the description of the KMS key.
*/
readonly keyDescription: pulumi.Output<string | undefined>;
/**
* The ID of the KMS key.
*/
readonly keyId: pulumi.Output<string>;
/**
* The current status of the KMS key.
* The valid values are as follows:
* + **1**: To be activated.
* + **2**: Enabled.
* + **3**: Disabled.
* + **4**: Pending deletion.
* + **5**: Pending import.
*/
readonly keyState: pulumi.Output<string>;
/**
* Specifies the KMS key usage.
* Changing this parameter will create a new resource.
* The value can be **ENCRYPT_DECRYPT** (symmetric key default value) or **SIGN_VERIFY** (asymmetric key default value).
*/
readonly keyUsage: pulumi.Output<string>;
/**
* Specifies the keystore ID to which the KMS key belongs.
* Changing this parameter will create a new resource.
* The KMS default keystore is used by default.
*/
readonly keystoreId: pulumi.Output<string>;
/**
* Specifies the source of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **kms**. The valid values are as follows:
* + **kms**: The key is generated by KMS.
* + **external**: The key is external imported.
*/
readonly origin: pulumi.Output<string>;
/**
* Specifies the number of days after which the KMS key is scheduled to be deleted.
* The valid value range from `7` to `1,096`.
*/
readonly pendingDays: pulumi.Output<string | undefined>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies whether the KMS key rotation is enabled.
* The default value is **false**.
*/
readonly rotationEnabled: pulumi.Output<boolean | undefined>;
/**
* Specifies the KMS key rotation period.
* The valid value range from `30` to `365`. The default value is `365`.
*/
readonly rotationInterval: pulumi.Output<number>;
/**
* The total number of key rotations.
*/
readonly rotationNumber: pulumi.Output<number>;
/**
* The scheduled deletion time of the KMS key.
* The value is a time stamp, e.g. **1723272402000**.
*/
readonly scheduledDeletionDate: pulumi.Output<string>;
/**
* Specifies the key/value pairs to associate with the KMS key.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Create a Key resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: KeyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Key resources.
*/
export interface KeyState {
/**
* The creation time of the KMS key.
* The value is a time stamp, e.g. **1723272402000**.
*/
creationDate?: pulumi.Input<string>;
/**
* The default master Key identifier.
* The value can be **1** (indicated the KMS key is default master key) or
* **0** (indicated the KMS key is not default master key).
*/
defaultKeyFlag?: pulumi.Input<string>;
/**
* The ID of the user account.
*/
domainId?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID to which the KMS key belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* The expiration time of the KMS key material.
* The value is a time stamp, e.g. **1723272402000**.
*/
expirationTime?: pulumi.Input<string>;
/**
* Specifies whether the KMS key is enabled.
* The default value is **true**.
* This parameter is not supported when creating an external import key for the first time.
*/
isEnabled?: pulumi.Input<boolean>;
/**
* Specifies the generation algorithm of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **AES_256**. The valid values are as follows:
* + **AES_256**
* + **SM4**
* + **RSA_2048**
* + **RSA_3072**
* + **RSA_4096**
* + **EC_P256**
* + **EC_P384**
* + **SM2**
*/
keyAlgorithm?: pulumi.Input<string>;
/**
* Specifies the alias name of the KMS key.
* Only letters, digits, underscores(_), hyphens(-), colons(:) and slash(/) are allowed.
* The valid length is limited from `1` to `255` characters.
* The name must be different from the alias of the default master key.
*/
keyAlias?: pulumi.Input<string>;
/**
* Specifies the description of the KMS key.
*/
keyDescription?: pulumi.Input<string>;
/**
* The ID of the KMS key.
*/
keyId?: pulumi.Input<string>;
/**
* The current status of the KMS key.
* The valid values are as follows:
* + **1**: To be activated.
* + **2**: Enabled.
* + **3**: Disabled.
* + **4**: Pending deletion.
* + **5**: Pending import.
*/
keyState?: pulumi.Input<string>;
/**
* Specifies the KMS key usage.
* Changing this parameter will create a new resource.
* The value can be **ENCRYPT_DECRYPT** (symmetric key default value) or **SIGN_VERIFY** (asymmetric key default value).
*/
keyUsage?: pulumi.Input<string>;
/**
* Specifies the keystore ID to which the KMS key belongs.
* Changing this parameter will create a new resource.
* The KMS default keystore is used by default.
*/
keystoreId?: pulumi.Input<string>;
/**
* Specifies the source of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **kms**. The valid values are as follows:
* + **kms**: The key is generated by KMS.
* + **external**: The key is external imported.
*/
origin?: pulumi.Input<string>;
/**
* Specifies the number of days after which the KMS key is scheduled to be deleted.
* The valid value range from `7` to `1,096`.
*/
pendingDays?: pulumi.Input<string>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies whether the KMS key rotation is enabled.
* The default value is **false**.
*/
rotationEnabled?: pulumi.Input<boolean>;
/**
* Specifies the KMS key rotation period.
* The valid value range from `30` to `365`. The default value is `365`.
*/
rotationInterval?: pulumi.Input<number>;
/**
* The total number of key rotations.
*/
rotationNumber?: pulumi.Input<number>;
/**
* The scheduled deletion time of the KMS key.
* The value is a time stamp, e.g. **1723272402000**.
*/
scheduledDeletionDate?: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the KMS key.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}
/**
* The set of arguments for constructing a Key resource.
*/
export interface KeyArgs {
/**
* Specifies the enterprise project ID to which the KMS key belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies whether the KMS key is enabled.
* The default value is **true**.
* This parameter is not supported when creating an external import key for the first time.
*/
isEnabled?: pulumi.Input<boolean>;
/**
* Specifies the generation algorithm of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **AES_256**. The valid values are as follows:
* + **AES_256**
* + **SM4**
* + **RSA_2048**
* + **RSA_3072**
* + **RSA_4096**
* + **EC_P256**
* + **EC_P384**
* + **SM2**
*/
keyAlgorithm?: pulumi.Input<string>;
/**
* Specifies the alias name of the KMS key.
* Only letters, digits, underscores(_), hyphens(-), colons(:) and slash(/) are allowed.
* The valid length is limited from `1` to `255` characters.
* The name must be different from the alias of the default master key.
*/
keyAlias: pulumi.Input<string>;
/**
* Specifies the description of the KMS key.
*/
keyDescription?: pulumi.Input<string>;
/**
* Specifies the KMS key usage.
* Changing this parameter will create a new resource.
* The value can be **ENCRYPT_DECRYPT** (symmetric key default value) or **SIGN_VERIFY** (asymmetric key default value).
*/
keyUsage?: pulumi.Input<string>;
/**
* Specifies the keystore ID to which the KMS key belongs.
* Changing this parameter will create a new resource.
* The KMS default keystore is used by default.
*/
keystoreId?: pulumi.Input<string>;
/**
* Specifies the source of the KMS key.
* Changing this parameter will create a new resource.
* The default value is **kms**. The valid values are as follows:
* + **kms**: The key is generated by KMS.
* + **external**: The key is external imported.
*/
origin?: pulumi.Input<string>;
/**
* Specifies the number of days after which the KMS key is scheduled to be deleted.
* The valid value range from `7` to `1,096`.
*/
pendingDays?: pulumi.Input<string>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies whether the KMS key rotation is enabled.
* The default value is **false**.
*/
rotationEnabled?: pulumi.Input<boolean>;
/**
* Specifies the KMS key rotation period.
* The valid value range from `30` to `365`. The default value is `365`.
*/
rotationInterval?: pulumi.Input<number>;
/**
* Specifies the key/value pairs to associate with the KMS key.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}