Interface AliasProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AliasProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:37.251Z")
@Stability(Stable)
public interface AliasProps
extends software.amazon.jsii.JsiiSerializable
Construction properties for a KMS Key Alias object.
Example:
/**
* Stack that defines the key
*/
public class KeyStack extends Stack {
public final Key key;
public KeyStack(App scope, String id) {
this(scope, id, null);
}
public KeyStack(App scope, String id, StackProps props) {
super(scope, id, props);
this.key = Key.Builder.create(this, "MyKey").removalPolicy(RemovalPolicy.DESTROY).build();
}
}
public class UseStackProps extends StackProps {
private IKey key;
public IKey getKey() {
return this.key;
}
public UseStackProps key(IKey key) {
this.key = key;
return this;
}
}
/**
* Stack that uses the key
*/
public class UseStack extends Stack {
public UseStack(App scope, String id, UseStackProps props) {
super(scope, id, props);
// Use the IKey object here.
// Use the IKey object here.
Alias.Builder.create(this, "Alias")
.aliasName("alias/foo")
.targetKey(props.getKey())
.build();
}
}
KeyStack keyStack = new KeyStack(app, "KeyStack");
new UseStack(app, "UseStack", new UseStackProps().key(keyStack.getKey()));
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAliasPropsstatic final classAn implementation forAliasProps -
Method Summary
Modifier and TypeMethodDescriptionstatic AliasProps.Builderbuilder()The name of the alias.default RemovalPolicyPolicy to apply when the alias is removed from this stack.The ID of the key for which you are creating the alias.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAliasName
The name of the alias.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.
-
getTargetKey
The ID of the key for which you are creating the alias.Specify the key's globally unique identifier or Amazon Resource Name (ARN). You can't specify another alias.
-
getRemovalPolicy
Policy to apply when the alias is removed from this stack.Default: - The alias will be deleted
-
builder
- Returns:
- a
AliasProps.BuilderofAliasProps
-