KeyPairAttributes Struct
Attributes of a Key Pair.
| Source | aws-ec2/lib/key-pair.ts |
|---|---|
| Type last changed |
Example
ts
const keyPair = ec2.KeyPair.fromKeyPairAttributes(this, 'KeyPair', {
keyPairName: 'the-keypair-name',
type: ec2.KeyPairType.RSA,
})
python
key_pair = ec2.KeyPair.from_key_pair_attributes(self, "KeyPair",
key_pair_name="the-keypair-name",
type=ec2.KeyPairType.RSA
)
java
IKeyPair keyPair = KeyPair.fromKeyPairAttributes(this, "KeyPair", KeyPairAttributes.builder()
.keyPairName("the-keypair-name")
.type(KeyPairType.RSA)
.build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var keyPair = KeyPair.FromKeyPairAttributes(this, "KeyPair", new KeyPairAttributes {
KeyPairName = "the-keypair-name",
Type = KeyPairType.RSA
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
keyPair := ec2.KeyPair_FromKeyPairAttributes(this, jsii.String("KeyPair"), &KeyPairAttributes{
KeyPairName: jsii.String("the-keypair-name"),
Type: ec2.KeyPairType_RSA,
})
Properties
The unique name of the key pair.
typeoptionalKeyPairTypetypeoptionalKeyPairTypetypeoptionalKeyPairTypeTypeoptionalKeyPairTypeTypeoptionalKeyPairType #The type of the key pair.
Default: no type specified