public String getKeyName() {
        return this.keyName;
    }
<p>
The name of the key pair. You can create a key pair using <a
href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or <a
href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.
</p>
<important>
<p>
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured
to allow users another way to log in.
</p>
</important>

@return The name of the key pair. You can create a key pair using <a
        href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html">CreateKeyPair</a> or
        <a
        href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html">ImportKeyPair</a>.
        </p> <important>
        <p>
        If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is
        configured to allow users another way to log in.
        </p>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/RunInstancesRequest.java