@Generated(value="jsii-pacmak/1.29.0 (build 41df200)", date="2021-06-02T09:55:31.600Z") @Stability(value=Experimental) public class Alias extends Resource implements IAlias
Using an alias to refer to a key can help you simplify key management. For example, when rotating keys, you can just update the alias mapping instead of tracking and changing key IDs. For more information, see Working with Aliases in the AWS Key Management Service Developer Guide.
You can also add an alias for a key by calling key.addAlias(alias).
| Modifier and Type | Class and Description |
|---|---|
static class |
Alias.Builder
(experimental) A fluent builder for
Alias. |
software.amazon.jsii.JsiiObject.InitializationModeIAlias.Jsii$Default, IAlias.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Alias(software.constructs.Construct scope,
String id,
AliasProps props) |
protected |
Alias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Alias(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Alias |
addAlias(String alias)
(experimental) Defines a new alias for the key.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement)
(experimental) Adds a statement to the KMS key resource policy.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement,
Boolean allowNoOp)
(experimental) Adds a statement to the KMS key resource policy.
|
static IAlias |
fromAliasAttributes(software.constructs.Construct scope,
String id,
AliasAttributes attrs)
(experimental) Import an existing KMS Alias defined outside the CDK app.
|
static IAlias |
fromAliasName(software.constructs.Construct scope,
String id,
String aliasName)
(experimental) Import an existing KMS Alias defined outside the CDK app, by the alias name.
|
protected String |
generatePhysicalName() |
String |
getAliasName()
(experimental) The name of the alias.
|
IKey |
getAliasTargetKey()
(experimental) The Key to which the Alias refers.
|
String |
getKeyArn()
(experimental) The ARN of the key.
|
String |
getKeyId()
(experimental) The ID of the key (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).
|
Grant |
grant(IGrantable grantee,
String... actions)
(experimental) Grant the indicated permissions on this key to the given principal.
|
Grant |
grantDecrypt(IGrantable grantee)
(experimental) Grant decryption permissions using this key to the given principal.
|
Grant |
grantEncrypt(IGrantable grantee)
(experimental) Grant encryption permissions using this key to the given principal.
|
Grant |
grantEncryptDecrypt(IGrantable grantee)
(experimental) Grant encryption and decryption permissions using this key to the given principal.
|
applyRemovalPolicy, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Alias(software.amazon.jsii.JsiiObjectRef objRef)
protected Alias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Alias(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
AliasProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Experimental) @NotNull public static IAlias fromAliasAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AliasAttributes attrs)
scope - The parent creating construct (usually `this`). This parameter is required.id - The construct's name. This parameter is required.attrs - the properties of the referenced KMS Alias. This parameter is required.@Stability(value=Experimental) @NotNull public static IAlias fromAliasName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String aliasName)
This method should be used instead of 'fromAliasAttributes' when the underlying KMS Key ARN is not available. This Alias will not have a direct reference to the KMS Key, so addAlias and grant* methods are not supported.
scope - The parent creating construct (usually `this`). This parameter is required.id - The construct's name. This parameter is required.aliasName - The full name of the KMS Alias (e.g., 'alias/aws/s3', 'alias/myKeyAlias'). This parameter is required.@Stability(value=Experimental) @NotNull public Alias addAlias(@NotNull String alias)
@Stability(value=Experimental) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement, @Nullable Boolean allowNoOp)
addToResourcePolicy in interface IKeystatement - This parameter is required.allowNoOp - @Stability(value=Experimental) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement)
addToResourcePolicy in interface IKeystatement - This parameter is required.@Stability(value=Experimental) @NotNull protected String generatePhysicalName()
generatePhysicalName in class Resource@Stability(value=Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
@Stability(value=Experimental) @NotNull public Grant grantDecrypt(@NotNull IGrantable grantee)
grantDecrypt in interface IKeygrantee - This parameter is required.@Stability(value=Experimental) @NotNull public Grant grantEncrypt(@NotNull IGrantable grantee)
grantEncrypt in interface IKeygrantee - This parameter is required.@Stability(value=Experimental) @NotNull public Grant grantEncryptDecrypt(@NotNull IGrantable grantee)
grantEncryptDecrypt in interface IKeygrantee - This parameter is required.@Stability(value=Experimental) @NotNull public String getAliasName()
getAliasName in interface IAlias@Stability(value=Experimental) @NotNull public IKey getAliasTargetKey()
getAliasTargetKey in interface IAlias@Stability(value=Experimental) @NotNull public String getKeyArn()
Copyright © 2021. All rights reserved.