Key
A kms key can help user to protect data security in the transmission process. For information about Alikms Key and how to use it, see What is Resource Alikms Key.
NOTE: Available in v1.85.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var key = new AliCloud.Kms.Key("key", new AliCloud.Kms.KeyArgs
{
Description = "Hello KMS",
KeyState = "Enabled",
PendingWindowInDays = 7,
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
key = alicloud.kms.Key("key",
description="Hello KMS",
key_state="Enabled",
pending_window_in_days="7")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const key = new alicloud.kms.Key("key", {
description: "Hello KMS",
keyState: "Enabled",
pendingWindowInDays: 7,
});Create a Key Resource
new Key(name: string, args?: KeyArgs, opts?: CustomResourceOptions);def Key(resource_name, opts=None, automatic_rotation=None, deletion_window_in_days=None, description=None, is_enabled=None, key_spec=None, key_state=None, key_usage=None, origin=None, pending_window_in_days=None, protection_level=None, rotation_interval=None, __props__=None);public Key(string name, KeyArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Key Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Key resource accepts the following input properties:
- Automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- Deletion
Window intIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- Description string
The description of the key as viewed in Alicloud console.
- Is
Enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- Key
Spec string The type of the CMK.
- Key
Status string The status of CMK. Defaults to Enabled.
- Key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- Origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- Pending
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- Rotation
Interval string The period of automatic key rotation. Unit: seconds.
- Automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- Deletion
Window intIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- Description string
The description of the key as viewed in Alicloud console.
- Is
Enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- Key
Spec string The type of the CMK.
- Key
State string The status of CMK. Defaults to Enabled.
- Key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- Origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- Pending
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- Rotation
Interval string The period of automatic key rotation. Unit: seconds.
- automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- deletion
Window numberIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- description string
The description of the key as viewed in Alicloud console.
- is
Enabled boolean Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- key
Spec string The type of the CMK.
- key
State string The status of CMK. Defaults to Enabled.
- key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- pending
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- rotation
Interval string The period of automatic key rotation. Unit: seconds.
- automatic_
rotation str Specifies whether to enable automatic key rotation. Default:“Disabled”.
- deletion_
window_ floatin_ days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- description str
The description of the key as viewed in Alicloud console.
- is_
enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- key_
spec str The type of the CMK.
- key_
state str The status of CMK. Defaults to Enabled.
- key_
usage str Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- origin str
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- pending_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- protection_
level str The protection level of the CMK. Defaults to “SOFTWARE”.
- rotation_
interval str The period of automatic key rotation. Unit: seconds.
Outputs
All input properties are implicitly available as output properties. Additionally, the Key resource produces the following output properties:
- Arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- Creation
Date string - Creator string
- Delete
Date string - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- Material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- Next
Rotation stringDate The time the next rotation is scheduled for execution.
- Primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- Arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- Creation
Date string - Creator string
- Delete
Date string - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- Material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- Next
Rotation stringDate The time the next rotation is scheduled for execution.
- Primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- creation
Date string - creator string
- delete
Date string - id string
- The provider-assigned unique ID for this managed resource.
- last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- next
Rotation stringDate The time the next rotation is scheduled for execution.
- primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- arn str
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- creation_
date str - creator str
- delete_
date str - id str
- The provider-assigned unique ID for this managed resource.
- last_
rotation_ strdate The date and time the last rotation was performed. The time is displayed in UTC.
- material_
expire_ strtime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- next_
rotation_ strdate The time the next rotation is scheduled for execution.
- primary_
key_ strversion The ID of the current primary key version of the symmetric CMK.
Look up an Existing Key Resource
Get an existing Key resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KeyState, opts?: CustomResourceOptions): Keystatic get(resource_name, id, opts=None, arn=None, automatic_rotation=None, creation_date=None, creator=None, delete_date=None, deletion_window_in_days=None, description=None, is_enabled=None, key_spec=None, key_state=None, key_usage=None, last_rotation_date=None, material_expire_time=None, next_rotation_date=None, origin=None, pending_window_in_days=None, primary_key_version=None, protection_level=None, rotation_interval=None, __props__=None);public static Key Get(string name, Input<string> id, KeyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- Automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- Creation
Date string - Creator string
- Delete
Date string - Deletion
Window intIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- Description string
The description of the key as viewed in Alicloud console.
- Is
Enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- Key
Spec string The type of the CMK.
- Key
Status string The status of CMK. Defaults to Enabled.
- Key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- Last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- Material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- Next
Rotation stringDate The time the next rotation is scheduled for execution.
- Origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- Pending
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- Protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- Rotation
Interval string The period of automatic key rotation. Unit: seconds.
- Arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- Automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- Creation
Date string - Creator string
- Delete
Date string - Deletion
Window intIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- Description string
The description of the key as viewed in Alicloud console.
- Is
Enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- Key
Spec string The type of the CMK.
- Key
State string The status of CMK. Defaults to Enabled.
- Key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- Last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- Material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- Next
Rotation stringDate The time the next rotation is scheduled for execution.
- Origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- Pending
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- Protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- Rotation
Interval string The period of automatic key rotation. Unit: seconds.
- arn string
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- automatic
Rotation string Specifies whether to enable automatic key rotation. Default:“Disabled”.
- creation
Date string - creator string
- delete
Date string - deletion
Window numberIn Days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- description string
The description of the key as viewed in Alicloud console.
- is
Enabled boolean Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- key
Spec string The type of the CMK.
- key
State string The status of CMK. Defaults to Enabled.
- key
Usage string Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- last
Rotation stringDate The date and time the last rotation was performed. The time is displayed in UTC.
- material
Expire stringTime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- next
Rotation stringDate The time the next rotation is scheduled for execution.
- origin string
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- pending
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- primary
Key stringVersion The ID of the current primary key version of the symmetric CMK.
- protection
Level string The protection level of the CMK. Defaults to “SOFTWARE”.
- rotation
Interval string The period of automatic key rotation. Unit: seconds.
- arn str
The Alicloud Resource Name (ARN) of the key. *
creation_date-The date and time when the CMK was created. The time is displayed in UTC. *creator-The creator of the CMK. *delete_date-The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.- automatic_
rotation str Specifies whether to enable automatic key rotation. Default:“Disabled”.
- creation_
date str - creator str
- delete_
date str - deletion_
window_ floatin_ days Field ‘deletion_window_in_days’ has been deprecated from provider version 1.85.0. New field ‘pending_window_in_days’ instead.
- description str
The description of the key as viewed in Alicloud console.
- is_
enabled bool Field ‘is_enabled’ has been deprecated from provider version 1.85.0. New field ‘key_state’ instead.
- key_
spec str The type of the CMK.
- key_
state str The status of CMK. Defaults to Enabled.
- key_
usage str Specifies the usage of CMK. Currently, default to ‘ENCRYPT/DECRYPT’, indicating that CMK is used for encryption and decryption.
- last_
rotation_ strdate The date and time the last rotation was performed. The time is displayed in UTC.
- material_
expire_ strtime The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
- next_
rotation_ strdate The time the next rotation is scheduled for execution.
- origin str
The source of the key material for the CMK. Defaults to “Aliyun_KMS”.
- pending_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- primary_
key_ strversion The ID of the current primary key version of the symmetric CMK.
- protection_
level str The protection level of the CMK. Defaults to “SOFTWARE”.
- rotation_
interval str The period of automatic key rotation. Unit: seconds.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.