@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.316Z") @Stability(value=Stable) public class CfnAlias extends CfnResource implements IInspectable
The AWS::KMS::Alias resource specifies a display name for a KMS key . You can use an alias to identify a KMS key in the AWS KMS console, in the DescribeKey operation, and in cryptographic operations , such as Decrypt and GenerateDataKey .
Adding, deleting, or updating an alias can allow or deny permission to the KMS key. For details, see ABAC for AWS KMS in the AWS Key Management Service Developer Guide .
Using an alias to refer to a KMS key can help you simplify key management. For example, an alias in your code can be associated with different KMS keys in different AWS Regions . For more information, see Using aliases in the AWS Key Management Service Developer Guide .
When specifying an alias, observe the following rules.
alias/projectKey in multiple Regions, each of which is associated with a KMS key in its Region.alias/ followed by a name, such as alias/exampleKey . The alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). Alias names cannot begin with alias/aws/ . That alias name prefix is reserved for AWS managed keys .Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.kms.*;
CfnAlias cfnAlias = CfnAlias.Builder.create(this, "MyCfnAlias")
.aliasName("aliasName")
.targetKeyId("targetKeyId")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnAlias.Builder
A fluent builder for
CfnAlias. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnAlias(software.constructs.Construct scope,
String id,
CfnAliasProps props)
Create a new `AWS::KMS::Alias`.
|
protected |
CfnAlias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnAlias(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAliasName()
Specifies the alias name.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getTargetKeyId()
Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) .
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAliasName(String value)
Specifies the alias name.
|
void |
setTargetKeyId(String value)
Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) .
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnAlias(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnAlias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnAlias(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnAliasProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAliasName()
If you change the value of a
Replacementproperty, such asAliasName, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC).
The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin with alias/aws/ . The alias/aws/ prefix is reserved for AWS managed keys .
Pattern : alias/^[a-zA-Z0-9/_-]+$
Minimum : 1
Maximum : 256
@Stability(value=Stable)
public void setAliasName(@NotNull
String value)
If you change the value of a
Replacementproperty, such asAliasName, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC).
The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin with alias/aws/ . The alias/aws/ prefix is reserved for AWS managed keys .
Pattern : alias/^[a-zA-Z0-9/_-]+$
Minimum : 1
Maximum : 256
@Stability(value=Stable) @NotNull public String getTargetKeyId()
A valid key ID is required. If you supply a null or empty string value, this operation returns an error.
For help finding the key ID and ARN, see Finding the key ID and ARN in the AWS Key Management Service Developer Guide .
Specify the key ID or the key ARN of the KMS key.
For example:
1234abcd-12ab-34cd-56ef-1234567890abarn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890abTo get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey .
@Stability(value=Stable)
public void setTargetKeyId(@NotNull
String value)
A valid key ID is required. If you supply a null or empty string value, this operation returns an error.
For help finding the key ID and ARN, see Finding the key ID and ARN in the AWS Key Management Service Developer Guide .
Specify the key ID or the key ARN of the KMS key.
For example:
1234abcd-12ab-34cd-56ef-1234567890abarn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890abTo get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey .
Copyright © 2022. All rights reserved.