enum KeyPairFormat
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.KeyPairFormat |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#KeyPairFormat |
Java | software.amazon.awscdk.services.ec2.KeyPairFormat |
Python | aws_cdk.aws_ec2.KeyPairFormat |
TypeScript (source) | aws-cdk-lib » aws_ec2 » KeyPairFormat |
The format 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 |
---|---|
PPK | A PPK file, typically used with PuTTY. |
PEM | A PEM file. |
PPK
A PPK file, typically used with PuTTY.
PEM
A PEM file.