interface KeyLookupOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.KMS.KeyLookupOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awskms#KeyLookupOptions |
Java | software.amazon.awscdk.services.kms.KeyLookupOptions |
Python | aws_cdk.aws_kms.KeyLookupOptions |
TypeScript (source) | aws-cdk-lib » aws_kms » KeyLookupOptions |
Properties for looking up an existing Key.
Example
const myKeyLookup = kms.Key.fromLookup(this, 'MyKeyLookup', {
aliasName: 'alias/KeyAlias',
});
const role = new iam.Role(this, 'MyRole', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
});
myKeyLookup.grantEncryptDecrypt(role);
Properties
Name | Type | Description |
---|---|---|
alias | string | The alias name of the Key. |
return | boolean | Whether to return a dummy key if the key was not found. |
aliasName
Type:
string
The alias name of the Key.
Must be in the format alias/<AliasName>
.
returnDummyKeyOnMissing?
Type:
boolean
(optional, default: false)
Whether to return a dummy key if the key was not found.
If it is set to true
and the key was not found, a dummy
key with a key id '1234abcd-12ab-34cd-56ef-1234567890ab'
will be returned. The value of the dummy key id can also
be referenced using the Key.DEFAULT_DUMMY_KEY_ID
variable,
and you can check if the key is a dummy key by using the
Key.isLookupDummy()
method.