Class AliasProps
Construction properties for a KMS Key Alias object.
Inheritance
System.Object
AliasProps
Implements
Namespace: Amazon.CDK.AWS.KMS
Assembly: Amazon.CDK.AWS.KMS.dll
Syntax (csharp)
public class AliasProps : Object, IAliasProps
Syntax (vb)
Public Class AliasProps
Inherits Object
Implements IAliasProps
Remarks
ExampleMetadata: lit=test/integ.key-sharing.lit.ts infused
Examples
/**
* Stack that defines the key
*/
class KeyStack : Stack
{
public Key Key { get; }
public KeyStack(App scope, string id, StackProps? props=null) : base(scope, id, props)
{
Key = new Key(this, "MyKey", new KeyProps { RemovalPolicy = RemovalPolicy.DESTROY });
}
}
class UseStackProps : StackProps
{
public IKey Key { get; set; }
}
/**
* Stack that uses the key
*/
class UseStack : Stack
{
public UseStack(App scope, string id, UseStackProps props) : base(scope, id, props)
{
// Use the IKey object here.
// Use the IKey object here.
new Alias(this, "Alias", new AliasProps {
AliasName = "alias/foo",
TargetKey = props.Key
});
}
}
var keyStack = new KeyStack(app, "KeyStack");
new UseStack(app, "UseStack", new UseStackProps { Key = keyStack.Key });
Synopsis
Constructors
AliasProps() |
Properties
AliasName | The name of the alias. |
RemovalPolicy | Policy to apply when the alias is removed from this stack. |
TargetKey | The ID of the key for which you are creating the alias. |
Constructors
AliasProps()
public AliasProps()
Properties
AliasName
The name of the alias.
public string AliasName { get; set; }
Property Value
System.String
Remarks
The name must start with alias followed by a forward slash, such as alias/. You can't specify aliases that begin with alias/AWS. These aliases are reserved.
RemovalPolicy
Policy to apply when the alias is removed from this stack.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: - The alias will be deleted
TargetKey
The ID of the key for which you are creating the alias.
public IKey TargetKey { get; set; }
Property Value
Remarks
Specify the key's globally unique identifier or Amazon Resource Name (ARN). You can't specify another alias.