Class CfnKeyPair.Builder

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

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

    • create

      @Stability(Stable) public static CfnKeyPair.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnKeyPair.Builder.
    • keyName

      @Stability(Stable) public CfnKeyPair.Builder keyName(String keyName)
      A unique name for the key pair.

      Constraints: Up to 255 ASCII characters

      Parameters:
      keyName - A unique name for the key pair. This parameter is required.
      Returns:
      this
    • keyType

      @Stability(Stable) public CfnKeyPair.Builder keyType(String 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

      Parameters:
      keyType - The type of key pair. Note that ED25519 keys are not supported for Windows instances. This parameter is required.
      Returns:
      this
    • publicKeyMaterial

      @Stability(Stable) public CfnKeyPair.Builder publicKeyMaterial(String 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.

      Parameters:
      publicKeyMaterial - The public key material. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnKeyPair.Builder tags(List<? extends CfnTag> tags)
      The tags to apply to the key pair.

      Parameters:
      tags - The tags to apply to the key pair. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnKeyPair build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnKeyPair>
      Returns:
      a newly built instance of CfnKeyPair.