Class KeyPair
An EC2 Key Pair.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class KeyPair : Resource, IKeyPair, IResource
Syntax (vb)
Public Class KeyPair
Inherits Resource
Implements IKeyPair, IResource
Remarks
Resource: AWS::EC2::KeyPair
ExampleMetadata: infused
Examples
var keyPair = KeyPair.FromKeyPairAttributes(this, "KeyPair", new KeyPairAttributes {
KeyPairName = "the-keypair-name",
Type = KeyPairType.RSA
});
Synopsis
Constructors
KeyPair(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
KeyPair(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
KeyPair(Construct, String, IKeyPairProps) |
Properties
Format | The format of the key pair. |
HasImportedMaterial | Whether the key material was imported. |
KeyPairFingerprint | The fingerprint of the key pair. |
KeyPairId | The unique ID of the key pair. |
KeyPairName | The unique name of the key pair. |
PrivateKey | The Systems Manager Parameter Store parameter with the pair's private key material. |
Type | The type of the key pair. |
Methods
FromKeyPairAttributes(Construct, String, IKeyPairAttributes) | Imports a key pair with a name and optional type. |
FromKeyPairName(Construct, String, String) | Imports a key pair based on the name. |
Constructors
KeyPair(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected KeyPair(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
KeyPair(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected KeyPair(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
KeyPair(Construct, String, IKeyPairProps)
public KeyPair(Construct scope, string id, IKeyPairProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IKeyPairProps
Properties
Format
The format of the key pair.
public virtual KeyPairFormat Format { get; }
Property Value
HasImportedMaterial
Whether the key material was imported.
public virtual bool HasImportedMaterial { get; }
Property Value
System.Boolean
Remarks
Keys with imported material do not have their private key material stored or returned automatically.
KeyPairFingerprint
The fingerprint of the key pair.
public virtual string KeyPairFingerprint { get; }
Property Value
System.String
Remarks
Attribute: true
KeyPairId
The unique ID of the key pair.
public virtual string KeyPairId { get; }
Property Value
System.String
Remarks
Attribute: true
KeyPairName
The unique name of the key pair.
public virtual string KeyPairName { get; }
Property Value
System.String
Remarks
Attribute: true
PrivateKey
The Systems Manager Parameter Store parameter with the pair's private key material.
public virtual IStringParameter PrivateKey { get; }
Property Value
Type
The type of the key pair.
public virtual Nullable<KeyPairType> Type { get; }
Property Value
System.Nullable<KeyPairType>
Methods
FromKeyPairAttributes(Construct, String, IKeyPairAttributes)
Imports a key pair with a name and optional type.
public static IKeyPair FromKeyPairAttributes(Construct scope, string id, IKeyPairAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IKeyPairAttributes
Returns
FromKeyPairName(Construct, String, String)
Imports a key pair based on the name.
public static IKeyPair FromKeyPairName(Construct scope, string id, string keyPairName)
Parameters
- scope Constructs.Construct
- id System.String
- keyPairName System.String
Returns