0
Boto3
(リソースレベル)KeyPair
とKeypairInfo
オブジェクトの目的は何ですか?ドキュメントがまだ再び曖昧..ですBoto3:(EC2)KeyPairとKeyPairInfoの違い
import boto3
ec2 = boto3.resource('ec2')
key_pair = ec2.KeyPair('name')
key_pair = ec2.KeyPairInfo('name')
重要なのは、KeyPairInfo
は全く動作しません:AttributeError: 'ec2.ServiceResource' object has no attribute 'KeyPairInfo'
さらに:どちらも、新しい鍵ペアを作成することはできません
AttributeError: 'ec2.KeyPairInfo' object has no attribute 'key_material'
。これは、作成中にkey_material
が一度ユーザーに与えられたためです。だけの情報のため、私は主に秘密鍵を返さないbotocore(client)
'応答= ec2.KeyPair( '名前')'で動作します。指紋と名前だけが返されます。ドキュメントには 'response.key_material'が返されると書かれていますが、awsは私有鍵を格納していないのでfalseです[http://boto3.readthedocs.org/en/latest/reference/services/ec2.html#keypair] – bluemoon