Interface KeyPairProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, ResourceProps
All Known Implementing Classes:
KeyPairProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-02T15:58:24.807Z") @Stability(Stable) public interface KeyPairProps extends software.amazon.jsii.JsiiSerializable, ResourceProps
The properties of a Key Pair.

Example:

 Vpc vpc;
 InstanceType instanceType;
 KeyPair keyPair = KeyPair.Builder.create(this, "KeyPair")
         .type(KeyPairType.ED25519)
         .format(KeyPairFormat.PEM)
         .build();
 Instance instance = Instance.Builder.create(this, "Instance")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(MachineImage.latestAmazonLinux2023())
         // Use the custom key pair
         .keyPair(keyPair)
         .build();
 
  • Method Details

    • getFormat

      @Stability(Stable) @Nullable default KeyPairFormat getFormat()
      The format of the key pair.

      Default: PEM

    • getKeyPairName

      @Stability(Stable) @Nullable default String getKeyPairName()
      A unique name for the key pair.

      Default: A generated name

    • getPublicKeyMaterial

      @Stability(Stable) @Nullable default String getPublicKeyMaterial()
      The public key material.

      If this is provided the key is considered "imported". For imported keys, it is assumed that you already have the private key material so the private key material will not be returned or stored in AWS Systems Manager Parameter Store.

      Default: a public and private key will be generated

    • getType

      @Stability(Stable) @Nullable default KeyPairType getType()
      The type of key pair.

      Default: RSA (ignored if keyMaterial is provided)

    • builder

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