Class 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",
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Kms
Assembly: Pulumi.AliCloud.dll
Syntax
public class Key : CustomResource
Constructors
View SourceKey(String, KeyArgs, CustomResourceOptions)
Create a Key resource with the given unique name, arguments, and options.
Declaration
public Key(string name, KeyArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| KeyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
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.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AutomaticRotation
Specifies whether to enable automatic key rotation. Default:"Disabled".
Declaration
public Output<string> AutomaticRotation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreationDate
Declaration
public Output<string> CreationDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Creator
Declaration
public Output<string> Creator { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DeleteDate
Declaration
public Output<string> DeleteDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DeletionWindowInDays
Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.
Declaration
public Output<int?> DeletionWindowInDays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Description
The description of the key as viewed in Alicloud console.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IsEnabled
Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.
Declaration
public Output<bool?> IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
KeySpec
The type of the CMK.
Declaration
public Output<string> KeySpec { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KeyStatus
The status of CMK. Defaults to Enabled.
Declaration
public Output<string> KeyStatus { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KeyUsage
Specifies the usage of CMK. Currently, default to 'ENCRYPT/DECRYPT', indicating that CMK is used for encryption and decryption.
Declaration
public Output<string> KeyUsage { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LastRotationDate
The date and time the last rotation was performed. The time is displayed in UTC.
Declaration
public Output<string> LastRotationDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaterialExpireTime
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.
Declaration
public Output<string> MaterialExpireTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NextRotationDate
The time the next rotation is scheduled for execution.
Declaration
public Output<string> NextRotationDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Origin
The source of the key material for the CMK. Defaults to "Aliyun_KMS".
Declaration
public Output<string> Origin { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PendingWindowInDays
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.
Declaration
public Output<int?> PendingWindowInDays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
PrimaryKeyVersion
The ID of the current primary key version of the symmetric CMK.
Declaration
public Output<string> PrimaryKeyVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ProtectionLevel
The protection level of the CMK. Defaults to "SOFTWARE".
Declaration
public Output<string> ProtectionLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RotationInterval
The period of automatic key rotation. Unit: seconds.
Declaration
public Output<string> RotationInterval { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, KeyState, CustomResourceOptions)
Get an existing Key resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Key Get(string name, Input<string> id, KeyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| KeyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Key |