Class: AWSCDK::Transfer::CfnConnector::SftpConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
transfer/cfn_connector.rb

Overview

A structure that contains the parameters for an SFTP connector object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_concurrent_connections: nil, trusted_host_keys: nil, user_secret_id: nil) ⇒ SftpConfigProperty

Returns a new instance of SftpConfigProperty.

Parameters:

  • max_concurrent_connections (Numeric, nil) (defaults to: nil)

    Specify the number of concurrent connections that your connector creates to the remote server.

  • trusted_host_keys (Array<String>, nil) (defaults to: nil)

    The public portion of the host key, or keys, that are used to identify the external server to which you are connecting.

  • user_secret_id (String, nil) (defaults to: nil)

    The identifier for the secret (in AWS Secrets Manager) that contains the SFTP user's private key, password, or both.



993
994
995
996
997
998
999
1000
# File 'transfer/cfn_connector.rb', line 993

def initialize(max_concurrent_connections: nil, trusted_host_keys: nil, user_secret_id: nil)
  @max_concurrent_connections = max_concurrent_connections
  Jsii::Type.check_type(@max_concurrent_connections, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxConcurrentConnections") unless @max_concurrent_connections.nil?
  @trusted_host_keys = trusted_host_keys
  Jsii::Type.check_type(@trusted_host_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "trustedHostKeys") unless @trusted_host_keys.nil?
  @user_secret_id = user_secret_id
  Jsii::Type.check_type(@user_secret_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userSecretId") unless @user_secret_id.nil?
end

Instance Attribute Details

#max_concurrent_connectionsNumeric? (readonly)

Note:

Default: - 1

Specify the number of concurrent connections that your connector creates to the remote server.

The default value is 1 . The maximum values is 5 .

If you are using the AWS Management Console , the default value is 5 .

This parameter specifies the number of active connections that your connector can establish with the remote server at the same time. Increasing this value can enhance connector performance when transferring large file batches by enabling parallel operations.



1013
1014
1015
# File 'transfer/cfn_connector.rb', line 1013

def max_concurrent_connections
  @max_concurrent_connections
end

#trusted_host_keysArray<String>? (readonly)

The public portion of the host key, or keys, that are used to identify the external server to which you are connecting.

You can use the ssh-keyscan command against the SFTP server to retrieve the necessary key.

TrustedHostKeys is optional for CreateConnector . If not provided, you can use TestConnection to retrieve the server host key during the initial connection attempt, and subsequently update the connector with the observed host key.

When creating connectors with egress config (VPC_LATTICE type connectors), since host name is not something we can verify, the only accepted trusted host key format is key-type key-body without the host name. For example: ssh-rsa AAAAB3Nza...<long-string-for-public-key>

The three standard SSH public key format elements are <key type> , <body base64> , and an optional <comment> , with spaces between each element. Specify only the <key type> and <body base64> : do not enter the <comment> portion of the key.

For the trusted host key, AWS Transfer Family accepts RSA and ECDSA keys.

  • For RSA keys, the <key type> string is ssh-rsa .
  • For ECDSA keys, the <key type> string is either ecdsa-sha2-nistp256 , ecdsa-sha2-nistp384 , or ecdsa-sha2-nistp521 , depending on the size of the key you generated.

Run this command to retrieve the SFTP server host key, where your SFTP server name is ftp.host.com .

ssh-keyscan ftp.host.com

This prints the public host key to standard output.

ftp.host.com ssh-rsa AAAAB3Nza...<long-string-for-public-key>

Copy and paste this string into the TrustedHostKeys field for the create-connector command or into the Trusted host keys field in the console.

For VPC Lattice type connectors (VPC_LATTICE), remove the hostname from the key and use only the key-type key-body format. In this example, it should be: ssh-rsa AAAAB3Nza...<long-string-for-public-key>



1043
1044
1045
# File 'transfer/cfn_connector.rb', line 1043

def trusted_host_keys
  @trusted_host_keys
end

#user_secret_idString? (readonly)

The identifier for the secret (in AWS Secrets Manager) that contains the SFTP user's private key, password, or both.

The identifier must be the Amazon Resource Name (ARN) of the secret.

  • Required when creating an SFTP connector
  • Optional when updating an existing SFTP connector


1053
1054
1055
# File 'transfer/cfn_connector.rb', line 1053

def user_secret_id
  @user_secret_id
end

Class Method Details

.jsii_propertiesObject



1055
1056
1057
1058
1059
1060
1061
# File 'transfer/cfn_connector.rb', line 1055

def self.jsii_properties
  {
    :max_concurrent_connections => "maxConcurrentConnections",
    :trusted_host_keys => "trustedHostKeys",
    :user_secret_id => "userSecretId",
  }
end

Instance Method Details

#to_jsiiObject



1063
1064
1065
1066
1067
1068
1069
1070
1071
# File 'transfer/cfn_connector.rb', line 1063

def to_jsii
  result = {}
  result.merge!({
    "maxConcurrentConnections" => @max_concurrent_connections,
    "trustedHostKeys" => @trusted_host_keys,
    "userSecretId" => @user_secret_id,
  })
  result.compact
end