interface CfnKeyPairProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.EC2.CfnKeyPairProps |
Java | software.amazon.awscdk.services.ec2.CfnKeyPairProps |
Python | aws_cdk.aws_ec2.CfnKeyPairProps |
TypeScript | @aws-cdk/aws-ec2 » CfnKeyPairProps |
Properties for defining a CfnKeyPair.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2 from '@aws-cdk/aws-ec2';
const cfnKeyPairProps: ec2.CfnKeyPairProps = {
keyName: 'keyName',
// the properties below are optional
keyType: 'keyType',
publicKeyMaterial: 'publicKeyMaterial',
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
| Name | Type | Description |
|---|---|---|
| key | string | A unique name for the key pair. |
| key | string | The type of key pair. Note that ED25519 keys are not supported for Windows instances. |
| public | string | The public key material. |
| tags? | Cfn[] | The tags to apply to the key pair. |
keyName
Type:
string
A unique name for the key pair.
Constraints: Up to 255 ASCII characters
keyType?
Type:
string
(optional)
The type of key pair. Note that ED25519 keys are not supported for Windows instances.
If the PublicKeyMaterial property is specified, the KeyType property is ignored, and the key type is inferred from the PublicKeyMaterial value.
Default: rsa
publicKeyMaterial?
Type:
string
(optional)
The public key material.
The PublicKeyMaterial property is used to import a key pair. If this property is not specified, then a new key pair will be created.
tags?
Type:
Cfn[]
(optional)
The tags to apply to the key pair.

.NET
Java
Python
TypeScript