Key
This class encapsulates and extends the ROS resource type ALIYUN::KMS::Key
, which is used to create a customer master key (CMK).
Initializers
import com.aliyun.ros.cdk.kms.Key;
Key.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
// .description(java.lang.String)
// .description(IResolvable)
// .dkmsInstanceId(java.lang.String)
// .dkmsInstanceId(IResolvable)
// .enable(java.lang.Boolean)
// .enable(IResolvable)
// .enableAutomaticRotation(java.lang.Boolean)
// .enableAutomaticRotation(IResolvable)
// .keySpec(java.lang.String)
// .keySpec(IResolvable)
// .keyUsage(java.lang.String)
// .keyUsage(IResolvable)
// .pendingWindowInDays(java.lang.Number)
// .pendingWindowInDays(IResolvable)
// .policy(IResolvable)
// .policy(java.util.Map<java.lang.String, java.lang.Object>)
// .protectionLevel(java.lang.String)
// .protectionLevel(IResolvable)
// .rotationInterval(java.lang.String)
// .rotationInterval(IResolvable)
.build();
Name | Type | Description |
---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
No description. |
id |
java.lang.String |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
description |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property description: The description of the CMK. |
dkmsInstanceId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property dkmsInstanceId: The ID of the dedicated KMS instance. |
enable |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property enable: Specifies whether the key is enabled. |
enableAutomaticRotation |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property enableAutomaticRotation: Whether to enable automatic key rotation. |
keySpec |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property keySpec: Key type. |
keyUsage |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property keyUsage: The usage of the CMK. |
pendingWindowInDays |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property pendingWindowInDays: The waiting period, specified in number of days. |
policy |
com.aliyun.ros.cdk.core.IResolvable OR java.util.Map |
Property policy: The policy of key. |
protectionLevel |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property protectionLevel: The protection level of the CMK to create. |
rotationInterval |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property rotationInterval: The time period for automatic rotation. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
description
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property description: The description of the CMK.
Length constraints: Minimum length of 0 characters. Maximum length of 8192 characters.
dkmsInstanceId
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property dkmsInstanceId: The ID of the dedicated KMS instance.
enable
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property enable: Specifies whether the key is enabled.
Defaults to true.
enableAutomaticRotation
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property enableAutomaticRotation: Whether to enable automatic key rotation.
Valid value: true/false (default)
keySpec
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property keySpec: Key type.
Valid value: Aliyun_AES_256/Aliyun_SM4/RSA_2048/EC_P256/EC_P256K/EC_SM2
keyUsage
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property keyUsage: The usage of the CMK.
Valid values: ENCRYPT/DECRYPT: encrypts or decrypts data. SIGN/VERIFY: generates or verifies a digital signature. If the CMK supports signature verification, the default value is SIGN/VERIFY. If the CMK does not support signature verification, the default value is ENCRYPT/DECRYPT.
pendingWindowInDays
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property pendingWindowInDays: The waiting period, specified in number of days.
During this period, you can cancel the CMK in PendingDeletion status. After the waiting period expires, you cannot cancel the deletion. The value must be between 7 and 366. Default value is 30.
policy
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
Property policy: The policy of key.
protectionLevel
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property protectionLevel: The protection level of the CMK to create.
Valid value: SOFTWARE and HSM. When this parameter is set to HSM: If the Origin parameter is set to Aliyun_KMS, the CMK is created in Managed HSM. If the Origin parameter is set to EXTERNAL, you can import external keys to Managed HSM.
rotationInterval
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property rotationInterval: The time period for automatic rotation.
The format is integer[unit], where integer represents the length of time and unit represents the time unit. The legal unit units are: d (day), h (hour), m (minute), s (second). 7d or 604800s both represent a 7-day cycle. Value: 7~730 days.
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition |
No description. |
addCount |
No description. |
addDependency |
No description. |
addResourceDesc |
No description. |
applyRemovalPolicy |
No description. |
getAtt |
No description. |
setMetadata |
No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.kms.Key;
Key.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
ref |
java.lang.String |
No description. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this resource is defined. |
resource |
com.aliyun.ros.cdk.core.RosResource |
No description. |
attrKeyId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute KeyId: The globally unique identifier for the CMK. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrKeyId
Required
public IResolvable getAttrKeyId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute KeyId: The globally unique identifier for the CMK.