【发布时间】:2015-11-20 22:06:00
【问题描述】:
boto3 1.1.2 文档say that the create_key_pair command 应该返回一个包含新创建的密钥对的私钥的字典。
我确实在使用那个版本……
>>> import boto3
>>> boto3.__version__
'1.1.2'
...然而,当我运行 create_key_pair 时,我却返回了一个 KeyPair object,它似乎不包含有关私钥的任何信息。确实创建了密钥对,只是我无法检索私钥,因为it is only ever available at the time of the keypair's creation。较旧的 boto API 显然在 KeyPair 对象上有一个 .save 方法来将密钥保存到文件中,但这似乎也已从 API 中删除。
在 boto3 1.1.2 中,如何创建新的 EC2 密钥对并检索其私钥?
【问题讨论】:
标签: amazon-ec2 boto3