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.104.0 (build e79254c)", date="2024-11-21T06:34:10.240Z") @Stability(Stable) public interface IKey extends software.amazon.jsii.JsiiSerializable, IResource
A KMS Key, either managed by this CDK app, or imported.
  • Method Details

    • getKeyArn

      @Stability(Stable) @NotNull String getKeyArn()
      The ARN of the key.
    • getKeyId

      @Stability(Stable) @NotNull String getKeyId()
      The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).
    • addAlias

      @Stability(Stable) @NotNull Alias addAlias(@NotNull String alias)
      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 to false 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

      @Stability(Stable) @NotNull Grant grantDecrypt(@NotNull IGrantable grantee)
      Grant decryption permissions using this key to the given principal.

      Parameters:
      grantee - This parameter is required.
    • grantEncrypt

      @Stability(Stable) @NotNull Grant grantEncrypt(@NotNull IGrantable grantee)
      Grant encryption permissions using this key to the given principal.

      Parameters:
      grantee - This parameter is required.
    • grantEncryptDecrypt

      @Stability(Stable) @NotNull Grant grantEncryptDecrypt(@NotNull IGrantable grantee)
      Grant encryption and decryption permissions using this key to the given principal.

      Parameters:
      grantee - This parameter is required.
    • grantGenerateMac

      @Stability(Stable) @NotNull Grant grantGenerateMac(@NotNull IGrantable grantee)
      Grant permissions to generating MACs to the given principal.

      Parameters:
      grantee - This parameter is required.
    • grantVerifyMac

      @Stability(Stable) @NotNull Grant grantVerifyMac(@NotNull IGrantable grantee)
      Grant permissions to verifying MACs to the given principal.

      Parameters:
      grantee - This parameter is required.