public static final class IKey.Jsii$Proxy extends software.amazon.jsii.JsiiObject implements IKey.Jsii$Default
IKey.Jsii$Default, IKey.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
Alias |
addAlias(java.lang.String alias)
Defines a new alias for the key.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement)
Adds a statement to the KMS key resource policy.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement,
java.lang.Boolean allowNoOp)
Adds a statement to the KMS key resource policy.
|
void |
applyRemovalPolicy(RemovalPolicy policy)
Apply the given removal policy to this resource.
|
ResourceEnvironment |
getEnv()
The environment this resource belongs to.
|
java.lang.String |
getKeyArn()
The ARN of the key.
|
java.lang.String |
getKeyId()
The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).
|
ConstructNode |
getNode()
The construct tree node for this construct.
|
Stack |
getStack()
The stack in which this resource is defined.
|
Grant |
grant(IGrantable grantee,
java.lang.String... actions)
Grant the indicated permissions on this key to the given principal.
|
Grant |
grantDecrypt(IGrantable grantee)
Grant decryption permissions using this key to the given principal.
|
Grant |
grantEncrypt(IGrantable grantee)
Grant encryption permissions using this key to the given principal.
|
Grant |
grantEncryptDecrypt(IGrantable grantee)
Grant encryption and decryption permissions using this key to the given principal.
|
public final ConstructNode getNode()
getNode
in interface IConstruct
getNode
in interface IConstruct.Jsii$Default
getNode
in interface IResource.Jsii$Default
getNode
in interface IKey.Jsii$Default
public final 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
getEnv
in interface IKey.Jsii$Default
public final Stack getStack()
getStack
in interface IResource
getStack
in interface IResource.Jsii$Default
getStack
in interface IKey.Jsii$Default
public final java.lang.String getKeyArn()
getKeyArn
in interface IKey
getKeyArn
in interface IKey.Jsii$Default
public final java.lang.String getKeyId()
getKeyId
in interface IKey
getKeyId
in interface IKey.Jsii$Default
public final 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
applyRemovalPolicy
in interface IKey.Jsii$Default
policy
- This parameter is required.public final Alias addAlias(java.lang.String alias)
addAlias
in interface IKey
addAlias
in interface IKey.Jsii$Default
alias
- This parameter is required.public final AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement, java.lang.Boolean allowNoOp)
addToResourcePolicy
in interface IKey
addToResourcePolicy
in interface IKey.Jsii$Default
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.public final AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
addToResourcePolicy
in interface IKey
statement
- The policy statement to add. This parameter is required.public final Grant grant(IGrantable grantee, java.lang.String... actions)
grant
in interface IKey
grant
in interface IKey.Jsii$Default
grantee
- This parameter is required.actions
- This parameter is required.public final Grant grantDecrypt(IGrantable grantee)
grantDecrypt
in interface IKey
grantDecrypt
in interface IKey.Jsii$Default
grantee
- This parameter is required.public final Grant grantEncrypt(IGrantable grantee)
grantEncrypt
in interface IKey
grantEncrypt
in interface IKey.Jsii$Default
grantee
- This parameter is required.public final Grant grantEncryptDecrypt(IGrantable grantee)
grantEncryptDecrypt
in interface IKey
grantEncryptDecrypt
in interface IKey.Jsii$Default
grantee
- This parameter is required.