Class CfnKeyPair
Specifies a key pair for use with an Amazon Elastic Compute Cloud instance as follows:.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnKeyPair : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnKeyPair
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
When you import an existing key pair, you specify the public key material for the key. We assume that you have the private key material for the key. AWS CloudFormation does not create or return the private key material when you import a key pair.
When you create a new key pair, the private key is saved to AWS Systems Manager Parameter Store, using a parameter with the following name: /ec2/keypair/{key_pair_id}
. For more information about retrieving private key, and the required permissions, see Create a key pair using AWS CloudFormation in the Amazon EC2 User Guide .
When AWS CloudFormation deletes a key pair that was created or imported by a stack, it also deletes the parameter that was used to store the private key material in Parameter Store.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-keypair.html
CloudformationResource: AWS::EC2::KeyPair
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnKeyPair = new CfnKeyPair(this, "MyCfnKeyPair", new CfnKeyPairProps {
KeyName = "keyName",
// the properties below are optional
KeyFormat = "keyFormat",
KeyType = "keyType",
PublicKeyMaterial = "publicKeyMaterial",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnKeyPair(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnKeyPair(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnKeyPair(Construct, String, ICfnKeyPairProps) |
Properties
AttrKeyFingerprint | If you created the key pair using Amazon EC2:. |
AttrKeyPairId | The ID of the key pair. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
KeyFormat | The format of the key pair. |
KeyName | A unique name for the key pair. |
KeyType | The type of key pair. |
PublicKeyMaterial | The public key material. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | The tags to apply to the key pair. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnKeyPair(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnKeyPair(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnKeyPair(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnKeyPair(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnKeyPair(Construct, String, ICfnKeyPairProps)
public CfnKeyPair(Construct scope, string id, ICfnKeyPairProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnKeyPairProps
Resource properties.
Properties
AttrKeyFingerprint
If you created the key pair using Amazon EC2:.
public virtual string AttrKeyFingerprint { get; }
Property Value
System.String
Remarks
If you imported the key pair to Amazon EC2:
CloudformationAttribute: KeyFingerprint
AttrKeyPairId
The ID of the key pair.
public virtual string AttrKeyPairId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: KeyPairId
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
KeyFormat
The format of the key pair.
public virtual string KeyFormat { get; set; }
Property Value
System.String
KeyName
A unique name for the key pair.
public virtual string KeyName { get; set; }
Property Value
System.String
KeyType
The type of key pair.
public virtual string KeyType { get; set; }
Property Value
System.String
Remarks
Note that ED25519 keys are not supported for Windows instances.
PublicKeyMaterial
The public key material.
public virtual string PublicKeyMaterial { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
The tags to apply to the key pair.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>