AWS Transfer Family

2022/09/13 - AWS Transfer Family - 5 new api methods

Changes  This release introduces the ability to have multiple server host keys for any of your Transfer Family servers that use the SFTP protocol.

DescribeHostKey (new) Link ¶

Returns the details of the host key that's specified by the HostKeyId and ServerId.

See also: AWS API Documentation

Request Syntax

client.describe_host_key(
    ServerId='string',
    HostKeyId='string'
)
type ServerId:

string

param ServerId:

[REQUIRED]

Provide the ID of the server that contains the host key that you want described.

type HostKeyId:

string

param HostKeyId:

[REQUIRED]

Provide the ID of the host key that you want described.

rtype:

dict

returns:

Response Syntax

{
    'HostKey': {
        'Arn': 'string',
        'HostKeyId': 'string',
        'HostKeyFingerprint': 'string',
        'Description': 'string',
        'Type': 'string',
        'DateImported': datetime(2015, 1, 1),
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • HostKey (dict) --

      Returns the details for the specified host key.

      • Arn (string) --

        The unique Amazon Resource Name (ARN) for the host key.

      • HostKeyId (string) --

        A unique identifier for the host key.

      • HostKeyFingerprint (string) --

        The public key fingerprint, which is a short sequence of bytes used to identify the longer public key.

      • Description (string) --

        The text description for this host key.

      • Type (string) --

        The encryption algorithm used for the host key. The Type is one of the following values:

        • ssh-rsa

        • ssh-ed25519

        • ecdsa-sha2-nistp256

        • ecdsa-sha2-nistp384

        • ecdsa-sha2-nistp521

      • DateImported (datetime) --

        The date on which the host key was added to the server.

      • 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) --

            The name assigned to the tag that you create.

          • Value (string) --

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

ListHostKeys (new) Link ¶

Returns a list of host keys for the server specified by the ServerId paramter.

See also: AWS API Documentation

Request Syntax

client.list_host_keys(
    MaxResults=123,
    NextToken='string',
    ServerId='string'
)
type MaxResults:

integer

param MaxResults:

The maximum number of host keys to return.

type NextToken:

string

param NextToken:

When there are additional results that were not returned, a NextToken parameter is returned. You can use that value for a subsequent call to ListHostKeys to continue listing results.

type ServerId:

string

param ServerId:

[REQUIRED]

Provide the ID of the server that contains the host keys that you want to view.

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'ServerId': 'string',
    'HostKeys': [
        {
            'Arn': 'string',
            'HostKeyId': 'string',
            'Fingerprint': 'string',
            'Description': 'string',
            'Type': 'string',
            'DateImported': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      Returns a token that you can use to call ListHostKeys again and receive additional results, if there are any.

    • ServerId (string) --

      Returns the server ID that contains the listed host keys.

    • HostKeys (list) --

      Returns an array, where each item contains the details of a host key.

      • (dict) --

        Returns properties of the host key that is specified.

        • Arn (string) --

          Specifies the unique Amazon Resource Name (ARN) of the host key.

        • HostKeyId (string) --

        • Fingerprint (string) --

          The public key fingerprint, which is a short sequence of bytes used to identify the longer public key.

        • Description (string) --

          The current description for the host key. You can change it by calling the UpdateHostKey operation and providing a new description.

        • Type (string) --

          The encryption algorithm used for the host key. The Type is one of the following values:

          • ssh-rsa

          • ssh-ed25519

          • ecdsa-sha2-nistp256

          • ecdsa-sha2-nistp384

          • ecdsa-sha2-nistp521

        • DateImported (datetime) --

          The date on which the host key was added to the server.

ImportHostKey (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.import_host_key(
    ServerId='string',
    HostKeyBody='string',
    Description='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ServerId:

string

param ServerId:

[REQUIRED]

Provide the ID of the server that contains the host key that you are importing.

type HostKeyBody:

string

param HostKeyBody:

[REQUIRED]

The public key portion of an SSH key pair.

Transfer Family accepts RSA, ECDSA, and ED25519 keys.

type Description:

string

param Description:

Enter a text description to identify this host key.

type Tags:

list

param Tags:

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.

rtype:

dict

returns:

Response Syntax

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

Response Structure

  • (dict) --

    • ServerId (string) --

      Returns the server ID that contains the imported key.

    • HostKeyId (string) --

      Returns the host key ID for the imported key.

DeleteHostKey (new) Link ¶

Deletes the host key that's specified in the HoskKeyId parameter.

See also: AWS API Documentation

Request Syntax

client.delete_host_key(
    ServerId='string',
    HostKeyId='string'
)
type ServerId:

string

param ServerId:

[REQUIRED]

Provide the ID of the server that contains the host key that you are deleting.

type HostKeyId:

string

param HostKeyId:

[REQUIRED]

The ID of the host key that you are deleting.

returns:

None

UpdateHostKey (new) Link ¶

Updates the description for the host key specified by the specified by the ServerId and HostKeyId parameters.

See also: AWS API Documentation

Request Syntax

client.update_host_key(
    ServerId='string',
    HostKeyId='string',
    Description='string'
)
type ServerId:

string

param ServerId:

[REQUIRED]

Provide the ID of the server that contains the host key that you are updating.

type HostKeyId:

string

param HostKeyId:

[REQUIRED]

Provide the ID of the host key that you are updating.

type Description:

string

param Description:

[REQUIRED]

Provide an updated description for the host key.

rtype:

dict

returns:

Response Syntax

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

Response Structure

  • (dict) --

    • ServerId (string) --

      Returns the server ID for the server that contains the updated host key.

    • HostKeyId (string) --

      Returns the host key ID for the updated host key.