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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnKeyPairProps.getKeyFormat()
Sets the value ofCfnKeyPairProps.getKeyName()
Sets the value ofCfnKeyPairProps.getKeyType()
publicKeyMaterial
(String publicKeyMaterial) Sets the value ofCfnKeyPairProps.getPublicKeyMaterial()
Sets the value ofCfnKeyPairProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
keyName
Sets the value ofCfnKeyPairProps.getKeyName()
- Parameters:
keyName
- A unique name for the key pair. This parameter is required. Constraints: Up to 255 ASCII characters- Returns:
this
-
keyFormat
Sets the value ofCfnKeyPairProps.getKeyFormat()
- Parameters:
keyFormat
- The format of the key pair. Default:pem
- Returns:
this
-
keyType
Sets the value ofCfnKeyPairProps.getKeyType()
- Parameters:
keyType
- The type of key pair. Note that ED25519 keys are not supported for Windows instances. If thePublicKeyMaterial
property is specified, theKeyType
property is ignored, and the key type is inferred from thePublicKeyMaterial
value.Default:
rsa
- Returns:
this
-
publicKeyMaterial
Sets the value ofCfnKeyPairProps.getPublicKeyMaterial()
- Parameters:
publicKeyMaterial
- The public key material. ThePublicKeyMaterial
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
Sets the value ofCfnKeyPairProps.getTags()
- Parameters:
tags
- The tags to apply to the key pair.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnKeyPairProps>
- Returns:
- a new instance of
CfnKeyPairProps
- Throws:
NullPointerException
- if any required attribute was not provided
-