public static interface IKey.Jsii$Default extends IKey, IResource.Jsii$Default
IKey
.IKey.Jsii$Default, IKey.Jsii$Proxy
Modifier and Type | Method and Description |
---|---|
default Alias |
addAlias(java.lang.String alias)
Defines a new alias for the key.
|
default AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement,
java.lang.Boolean allowNoOp)
Adds a statement to the KMS key resource policy.
|
default void |
applyRemovalPolicy(RemovalPolicy policy)
Apply the given removal policy to this resource.
|
default ResourceEnvironment |
getEnv()
The environment this resource belongs to.
|
default java.lang.String |
getKeyArn()
The ARN of the key.
|
default java.lang.String |
getKeyId()
The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).
|
default ConstructNode |
getNode()
The construct tree node for this construct.
|
default Stack |
getStack()
The stack in which this resource is defined.
|
default Grant |
grant(IGrantable grantee,
java.lang.String... actions)
Grant the indicated permissions on this key to the given principal.
|
default Grant |
grantDecrypt(IGrantable grantee)
Grant decryption permissions using this key to the given principal.
|
default Grant |
grantEncrypt(IGrantable grantee)
Grant encryption permissions using this key to the given principal.
|
default Grant |
grantEncryptDecrypt(IGrantable grantee)
Grant encryption and decryption permissions using this key to the given principal.
|
addToResourcePolicy
default ConstructNode getNode()
getNode
in interface IConstruct
getNode
in interface IConstruct.Jsii$Default
getNode
in interface IResource.Jsii$Default
default ResourceEnvironment getEnv()
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
getEnv
in interface IResource
getEnv
in interface IResource.Jsii$Default
default Stack getStack()
getStack
in interface IResource
getStack
in interface IResource.Jsii$Default
default java.lang.String getKeyArn()
default java.lang.String getKeyId()
default void applyRemovalPolicy(RemovalPolicy policy)
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
applyRemovalPolicy
in interface IResource
applyRemovalPolicy
in interface IResource.Jsii$Default
policy
- This parameter is required.default Alias addAlias(java.lang.String alias)
default AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement, java.lang.Boolean allowNoOp)
addToResourcePolicy
in interface IKey
statement
- The policy statement to add. This parameter is required.allowNoOp
- If this is set to `false` and there is no policy defined (i.e. external key), the operation will fail. Otherwise, it will no-op.default Grant grant(IGrantable grantee, java.lang.String... actions)
default Grant grantDecrypt(IGrantable grantee)
grantDecrypt
in interface IKey
grantee
- This parameter is required.default Grant grantEncrypt(IGrantable grantee)
grantEncrypt
in interface IKey
grantee
- This parameter is required.default Grant grantEncryptDecrypt(IGrantable grantee)
grantEncryptDecrypt
in interface IKey
grantee
- This parameter is required.