Class CfnKeyPairProps.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.CfnKeyPairProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnKeyPairProps>
Enclosing interface:
CfnKeyPairProps

@Stability(Stable) public static final class CfnKeyPairProps.Builder extends Object implements software.amazon.jsii.Builder<CfnKeyPairProps>
A builder for CfnKeyPairProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • keyName

      @Stability(Stable) public CfnKeyPairProps.Builder keyName(String keyName)
      Parameters:
      keyName - A unique name for the key pair. This parameter is required. Constraints: Up to 255 ASCII characters
      Returns:
      this
    • keyType

      @Stability(Stable) public CfnKeyPairProps.Builder keyType(String keyType)
      Parameters:
      keyType - The type of key pair. Note that ED25519 keys are not supported for Windows instances. If the PublicKeyMaterial property is specified, the KeyType property is ignored, and the key type is inferred from the PublicKeyMaterial value.

      Default: rsa

      Returns:
      this
    • publicKeyMaterial

      @Stability(Stable) public CfnKeyPairProps.Builder publicKeyMaterial(String publicKeyMaterial)
      Parameters:
      publicKeyMaterial - The public key material. The PublicKeyMaterial property is used to import a key pair. If this property is not specified, then a new key pair will be created.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnKeyPairProps.Builder tags(List<? extends CfnTag> tags)
      Sets the value of CfnKeyPairProps.getTags()
      Parameters:
      tags - The tags to apply to the key pair.
      Returns:
      this
    • build

      @Stability(Stable) public CfnKeyPairProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnKeyPairProps>
      Returns:
      a new instance of CfnKeyPairProps
      Throws:
      NullPointerException - if any required attribute was not provided