Class KeyPairProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.KeyPairProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KeyPairProps>
- Enclosing interface:
KeyPairProps
@Stability(Stable)
public static final class KeyPairProps.Builder
extends Object
implements software.amazon.jsii.Builder<KeyPairProps>
A builder for
KeyPairProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofResourceProps.getAccount()
build()
Builds the configured instance.environmentFromArn
(String environmentFromArn) Sets the value ofResourceProps.getEnvironmentFromArn()
format
(KeyPairFormat format) Sets the value ofKeyPairProps.getFormat()
keyPairName
(String keyPairName) Sets the value ofKeyPairProps.getKeyPairName()
physicalName
(String physicalName) Sets the value ofResourceProps.getPhysicalName()
publicKeyMaterial
(String publicKeyMaterial) Sets the value ofKeyPairProps.getPublicKeyMaterial()
Sets the value ofResourceProps.getRegion()
type
(KeyPairType type) Sets the value ofKeyPairProps.getType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
format
Sets the value ofKeyPairProps.getFormat()
- Parameters:
format
- The format of the key pair.- Returns:
this
-
keyPairName
Sets the value ofKeyPairProps.getKeyPairName()
- Parameters:
keyPairName
- A unique name for the key pair.- Returns:
this
-
publicKeyMaterial
Sets the value ofKeyPairProps.getPublicKeyMaterial()
- Parameters:
publicKeyMaterial
- 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.- Returns:
this
-
type
Sets the value ofKeyPairProps.getType()
- Parameters:
type
- The type of key pair.- Returns:
this
-
account
Sets the value ofResourceProps.getAccount()
- Parameters:
account
- The AWS account ID this resource belongs to.- Returns:
this
-
environmentFromArn
Sets the value ofResourceProps.getEnvironmentFromArn()
- Parameters:
environmentFromArn
- ARN to deduce region and account from. The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.Cannot be supplied together with either
account
orregion
.- Returns:
this
-
physicalName
Sets the value ofResourceProps.getPhysicalName()
- Parameters:
physicalName
- The value passed in by users to the physical name prop of the resource.undefined
implies that a physical name will be allocated by CloudFormation during deployment.- a concrete value implies a specific physical name
PhysicalName.GENERATE_IF_NEEDED
is a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
- Returns:
this
-
region
Sets the value ofResourceProps.getRegion()
- Parameters:
region
- The AWS region this resource belongs to.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<KeyPairProps>
- Returns:
- a new instance of
KeyPairProps
- Throws:
NullPointerException
- if any required attribute was not provided
-