Class KeyLookupOptions
Properties for looking up an existing Key.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.KMS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class KeyLookupOptions : IKeyLookupOptions
Syntax (vb)
Public Class KeyLookupOptions Implements IKeyLookupOptions
Remarks
ExampleMetadata: infused
Examples
var myKeyLookup = Key.FromLookup(this, "MyKeyLookup", new KeyLookupOptions {
AliasName = "alias/KeyAlias"
});
var role = new Role(this, "MyRole", new RoleProps {
AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});
myKeyLookup.GrantEncryptDecrypt(role);
Synopsis
Constructors
KeyLookupOptions() | Properties for looking up an existing Key. |
Properties
AliasName | The alias name of the Key. |
ReturnDummyKeyOnMissing | Whether to return a dummy key if the key was not found. |
Constructors
KeyLookupOptions()
Properties for looking up an existing Key.
public KeyLookupOptions()
Remarks
ExampleMetadata: infused
Examples
var myKeyLookup = Key.FromLookup(this, "MyKeyLookup", new KeyLookupOptions {
AliasName = "alias/KeyAlias"
});
var role = new Role(this, "MyRole", new RoleProps {
AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});
myKeyLookup.GrantEncryptDecrypt(role);
Properties
AliasName
The alias name of the Key.
public string AliasName { get; set; }
Property Value
Remarks
Must be in the format alias/<AliasName>
.
ReturnDummyKeyOnMissing
Whether to return a dummy key if the key was not found.
public bool? ReturnDummyKeyOnMissing { get; set; }
Property Value
bool?
Remarks
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.
Default: false