:doc:`ServiceResource <index>` / Sub-Resource / KeyPair

*******
KeyPair
*******



.. py:method:: EC2.ServiceResource.KeyPair(name)

  Creates a KeyPairInfo resource.::

    key_pair_info = ec2.KeyPair('name')

  :type name: string
  :param name: The KeyPair's name identifier. This **must** be set.
  
  :rtype: :py:class:`EC2.KeyPairInfo`
  :returns: A KeyPairInfo resource
  