Interface IKey
- All Superinterfaces:
software.constructs.IConstruct
,software.constructs.IDependable
,IResource
,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
IAlias
,IAlias.Jsii$Default
,IKey.Jsii$Default
- All Known Implementing Classes:
Alias
,IAlias.Jsii$Proxy
,IKey.Jsii$Proxy
,Key
@Generated(value="jsii-pacmak/1.102.0 (build e354887)",
date="2024-08-23T05:56:18.764Z")
@Stability(Stable)
public interface IKey
extends software.amazon.jsii.JsiiSerializable, IResource
A KMS Key, either managed by this CDK app, or imported.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Internal default implementation forIKey
.static final class
A proxy class which represents a concrete javascript instance of this type. -
Method Summary
Modifier and TypeMethodDescriptionDefines a new alias for the key.addToResourcePolicy
(PolicyStatement statement) Adds a statement to the KMS key resource policy.addToResourcePolicy
(PolicyStatement statement, Boolean allowNoOp) Adds a statement to the KMS key resource policy.The ARN of the key.getKeyId()
The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).grant
(IGrantable grantee, @NotNull String... actions) Grant the indicated permissions on this key to the given principal.grantDecrypt
(IGrantable grantee) Grant decryption permissions using this key to the given principal.grantEncrypt
(IGrantable grantee) Grant encryption permissions using this key to the given principal.grantEncryptDecrypt
(IGrantable grantee) Grant encryption and decryption permissions using this key to the given principal.grantGenerateMac
(IGrantable grantee) Grant permissions to generating MACs to the given principal.grantVerifyMac
(IGrantable grantee) Grant permissions to verifying MACs to the given principal.Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getKeyArn
The ARN of the key. -
getKeyId
The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab). -
addAlias
Defines a new alias for the key.- Parameters:
alias
- This parameter is required.
-
addToResourcePolicy
@Stability(Stable) @NotNull AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement, @Nullable Boolean allowNoOp) Adds a statement to the KMS key resource policy.- Parameters:
statement
- The policy statement to add. This parameter is required.allowNoOp
- If this is set tofalse
and there is no policy defined (i.e. external key), the operation will fail. Otherwise, it will no-op.
-
addToResourcePolicy
@Stability(Stable) @NotNull AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement) Adds a statement to the KMS key resource policy.- Parameters:
statement
- The policy statement to add. This parameter is required.
-
grant
@Stability(Stable) @NotNull Grant grant(@NotNull IGrantable grantee, @NotNull @NotNull String... actions) Grant the indicated permissions on this key to the given principal.- Parameters:
grantee
- This parameter is required.actions
- This parameter is required.
-
grantDecrypt
Grant decryption permissions using this key to the given principal.- Parameters:
grantee
- This parameter is required.
-
grantEncrypt
Grant encryption permissions using this key to the given principal.- Parameters:
grantee
- This parameter is required.
-
grantEncryptDecrypt
Grant encryption and decryption permissions using this key to the given principal.- Parameters:
grantee
- This parameter is required.
-
grantGenerateMac
Grant permissions to generating MACs to the given principal.- Parameters:
grantee
- This parameter is required.
-
grantVerifyMac
Grant permissions to verifying MACs to the given principal.- Parameters:
grantee
- This parameter is required.
-