enum KeyPairType
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.KeyPairType |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#KeyPairType |
Java | software.amazon.awscdk.services.ec2.KeyPairType |
Python | aws_cdk.aws_ec2.KeyPairType |
TypeScript (source) | aws-cdk-lib » aws_ec2 » KeyPairType |
The type of the key pair.
Example
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
const keyPair = new ec2.KeyPair(this, 'KeyPair', {
type: ec2.KeyPairType.ED25519,
format: ec2.KeyPairFormat.PEM,
});
const instance = new ec2.Instance(this, 'Instance', {
vpc,
instanceType,
machineImage: ec2.MachineImage.latestAmazonLinux2023(),
// Use the custom key pair
keyPair,
});
Members
Name | Description |
---|---|
RSA | An RSA key. |
ED25519 | An ED25519 key. |
RSA
An RSA key.
ED25519
An ED25519 key.
Note that ED25519 keys are not supported for Windows instances.