# KeyPairReference

A reference to a KeyPair resource.

- Source: Generated at build time
- Type last changed: v2.272.0 · 30 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as interfaces_lightsail } from 'aws-cdk-lib/interfaces';
const keyPairReference: interfaces_lightsail.KeyPairReference = {
  keyPairArn: 'keyPairArn',
  keyPairName: 'keyPairName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.interfaces import aws_lightsail as interfaces_lightsail

key_pair_reference = interfaces_lightsail.KeyPairReference(
    key_pair_arn="keyPairArn",
    key_pair_name="keyPairName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.interfaces.lightsail.*;

KeyPairReference keyPairReference = KeyPairReference.builder()
        .keyPairArn("keyPairArn")
        .keyPairName("keyPairName")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Interfaces.Lightsail;

var keyPairReference = new KeyPairReference {
    KeyPairArn = "keyPairArn",
    KeyPairName = "keyPairName"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keyPairReference := &KeyPairReference{
	KeyPairArn: jsii.String("keyPairArn"),
	KeyPairName: jsii.String("keyPairName"),
}
```

## Properties

- `keyPairArn`: string (required) — The ARN of the KeyPair resource.

- `keyPairName`: string (required) — The KeyPairName of the KeyPair resource.
