Transfer / Client / import_host_key

import_host_key

Transfer.Client.import_host_key(**kwargs)

Adds a host key to the server that’s specified by the ServerId parameter.

See also: AWS API Documentation

Request Syntax

response = client.import_host_key(
    ServerId='string',
    HostKeyBody='string',
    Description='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    StorageType='SERVICE_MANAGED'|'SECRETS_MANAGER',
    KmsKey='string'
)
Parameters:
  • ServerId (string) –

    [REQUIRED]

    The identifier of the server that contains the host key that you are importing.

  • HostKeyBody (string) –

    [REQUIRED]

    The private key portion of an SSH key pair.

    Transfer Family accepts RSA, ECDSA, and ED25519 keys.

  • Description (string) – The text description that identifies this host key.

  • Tags (list) –

    Key-value pairs that can be used to group and search for host keys.

    • (dict) –

      Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called Group and assign the values Research and Accounting to that group.

      • Key (string) – [REQUIRED]

        The name assigned to the tag that you create.

      • Value (string) – [REQUIRED]

        Contains one or more values that you assigned to the key name you create.

  • StorageType (string) – Specifies whether the host key is stored by Transfer Family ( SERVICE_MANAGED) or in Secrets Manager ( SECRETS_MANAGER). When you specify SECRETS_MANAGER, Transfer Family stores the private host key material in an Secrets Manager secret.

  • KmsKey (string) – The Amazon Resource Name (ARN) of the KMS key used to encrypt the Secrets Manager secret that stores the host key. If you specify a customer managed key, its key policy must allow the AWSServiceRoleForTransfer service-linked role to decrypt the secret. If you don’t specify a value, Transfer Family uses the Amazon Web Services managed key for Secrets Manager.

Return type:

dict

Returns:

Response Syntax

{
    'ServerId': 'string',
    'HostKeyId': 'string'
}

Response Structure

  • (dict) –

    • ServerId (string) –

      Returns the server identifier that contains the imported key.

    • HostKeyId (string) –

      Returns the host key identifier for the imported key.

Exceptions