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()));
 
  • Method Details

    • getAliasName

      @Stability(Stable) @NotNull String 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

      @Stability(Stable) @NotNull IKey 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

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      Policy to apply when the alias is removed from this stack.

      Default: - The alias will be deleted

    • builder

      @Stability(Stable) static AliasProps.Builder builder()
      Returns:
      a AliasProps.Builder of AliasProps