Class KeyPair.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KeyPair>
- Enclosing class:
KeyPair
KeyPair
.-
Method Summary
Modifier and TypeMethodDescriptionThe AWS account ID this resource belongs to.build()
static KeyPair.Builder
environmentFromArn
(String environmentFromArn) ARN to deduce region and account from.format
(KeyPairFormat format) The format of the key pair.keyPairName
(String keyPairName) A unique name for the key pair.physicalName
(String physicalName) The value passed in by users to the physical name prop of the resource.publicKeyMaterial
(String publicKeyMaterial) The public key material.The AWS region this resource belongs to.type
(KeyPairType type) The type of key pair.
-
Method Details
-
create
@Stability(Stable) public static KeyPair.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
KeyPair.Builder
.
-
account
The AWS account ID this resource belongs to.Default: - the resource is in the same account as the stack it belongs to
- Parameters:
account
- The AWS account ID this resource belongs to. This parameter is required.- Returns:
this
-
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
.Default: - take environment from `account`, `region` parameters, or use Stack environment.
- Parameters:
environmentFromArn
- ARN to deduce region and account from. This parameter is required.- Returns:
this
-
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.
Default: - The physical name will be allocated by CloudFormation at deployment time
- Parameters:
physicalName
- The value passed in by users to the physical name prop of the resource. This parameter is required.- Returns:
this
-
region
The AWS region this resource belongs to.Default: - the resource is in the same region as the stack it belongs to
- Parameters:
region
- The AWS region this resource belongs to. This parameter is required.- Returns:
this
-
format
The format of the key pair.Default: PEM
- Parameters:
format
- The format of the key pair. This parameter is required.- Returns:
this
-
keyPairName
A unique name for the key pair.Default: A generated name
- Parameters:
keyPairName
- A unique name for the key pair. This parameter is required.- Returns:
this
-
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.
Default: a public and private key will be generated
- Parameters:
publicKeyMaterial
- The public key material. This parameter is required.- Returns:
this
-
type
The type of key pair.Default: RSA (ignored if keyMaterial is provided)
- Parameters:
type
- The type of key pair. This parameter is required.- Returns:
this
-
build
-