Show / Hide Table of Contents

Interface IKeyPairProps

The properties of a Key Pair.

Inherited Members
IResourceProps.Account
IResourceProps.EnvironmentFromArn
IResourceProps.PhysicalName
IResourceProps.Region
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IKeyPairProps : IResourceProps
Syntax (vb)
Public Interface IKeyPairProps Inherits IResourceProps
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            InstanceType instanceType;


            var keyPair = new KeyPair(this, "KeyPair", new KeyPairProps {
                Type = KeyPairType.ED25519,
                Format = KeyPairFormat.PEM
            });
            var instance = new Instance(this, "Instance", new InstanceProps {
                Vpc = vpc,
                InstanceType = instanceType,
                MachineImage = MachineImage.LatestAmazonLinux2023(),
                // Use the custom key pair
                KeyPair = keyPair
            });

Synopsis

Properties

Format

The format of the key pair.

KeyPairName

A unique name for the key pair.

PublicKeyMaterial

The public key material.

Type

The type of key pair.

Properties

Format

The format of the key pair.

KeyPairFormat? Format { get; }
Property Value

KeyPairFormat?

Remarks

Default: PEM

KeyPairName

A unique name for the key pair.

string? KeyPairName { get; }
Property Value

string

Remarks

Default: A generated name

PublicKeyMaterial

The public key material.

string? PublicKeyMaterial { get; }
Property Value

string

Remarks

If this is provided the key is considered "imported". For imported keys, it is assumed that you already have the private key material so the private key material will not be returned or stored in AWS Systems Manager Parameter Store.

Default: a public and private key will be generated

Type

The type of key pair.

KeyPairType? Type { get; }
Property Value

KeyPairType?

Remarks

Default: RSA (ignored if keyMaterial is provided)

Back to top Generated by DocFX