Import Key Pair documentation - b64 requirement reversed #4321
Labels
documentation
This is a problem with documentation.
ec2
p3
This is a minor priority issue
response-requested
Waiting on additional information or feedback.
Describe the issue
The import key pair boto3 documentation does not correctly describe when the key must be base64-encoded. It's the reverse of what's listed. The upstream API documentation is also wrong, I'll submit a feedback to that as well.
The page states:
However, actually the aws cli requires the key to be base64 encoded and boto3 requires it not be base64 encoded.
Attempting to enter a base64 encoded key via cli gives an error:
This works:
Likewise, using boto3 to import a b64 encoded key (
client.import_key_pair(KeyName=default_key_name, PublicKeyMaterial=b64pub_key)
) gives this error:botocore.exceptions.ClientError: An error occurred (InvalidKey.Format) when calling the ImportKeyPair operation: Key is not in valid OpenSSH public key format
But passing in the non-b64 encoded public key works fine.
Links
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/import_key_pair.html
The text was updated successfully, but these errors were encountered: