Class KeyPair
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.KeyPair
- All Implemented Interfaces:
IResource
,IKeyPair
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)",
date="2024-05-02T15:58:24.806Z")
@Stability(Stable)
public class KeyPair
extends Resource
implements IKeyPair
An EC2 Key Pair.
Example:
IKeyPair keyPair = KeyPair.fromKeyPairAttributes(this, "KeyPair", KeyPairAttributes.builder() .keyPairName("the-keypair-name") .type(KeyPairType.RSA) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IKeyPair
IKeyPair.Jsii$Default, IKeyPair.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
KeyPair
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
KeyPair
(software.amazon.jsii.JsiiObjectRef objRef) KeyPair
(software.constructs.Construct scope, String id, KeyPairProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IKeyPair
fromKeyPairAttributes
(software.constructs.Construct scope, String id, KeyPairAttributes attrs) Imports a key pair with a name and optional type.static IKeyPair
fromKeyPairName
(software.constructs.Construct scope, String id, String keyPairName) Imports a key pair based on the name.The format of the key pair.Whether the key material was imported.The fingerprint of the key pair.The unique ID of the key pair.The unique name of the key pair.The Systems Manager Parameter Store parameter with the pair's private key material.getType()
The type of the key pair.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
KeyPair
protected KeyPair(software.amazon.jsii.JsiiObjectRef objRef) -
KeyPair
protected KeyPair(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
KeyPair
@Stability(Stable) public KeyPair(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable KeyPairProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
KeyPair
- Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromKeyPairAttributes
@Stability(Stable) @NotNull public static IKeyPair fromKeyPairAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull KeyPairAttributes attrs) Imports a key pair with a name and optional type.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
fromKeyPairName
@Stability(Stable) @NotNull public static IKeyPair fromKeyPairName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String keyPairName) Imports a key pair based on the name.- Parameters:
scope
- This parameter is required.id
- This parameter is required.keyPairName
- This parameter is required.
-
getFormat
The format of the key pair. -
getHasImportedMaterial
Whether the key material was imported.Keys with imported material do not have their private key material stored or returned automatically.
-
getKeyPairFingerprint
The fingerprint of the key pair. -
getKeyPairId
The unique ID of the key pair. -
getKeyPairName
The unique name of the key pair.- Specified by:
getKeyPairName
in interfaceIKeyPair
-
getPrivateKey
The Systems Manager Parameter Store parameter with the pair's private key material. -
getType
The type of the key pair.
-