DataSync / Client / create_location_hdfs

create_location_hdfs

DataSync.Client.create_location_hdfs(**kwargs)

Creates a transfer location for a Hadoop Distributed File System (HDFS). DataSync can use this location as a source or destination for transferring data.

Before you begin, make sure that you understand how DataSync accesses HDFS clusters.

See also: AWS API Documentation

Request Syntax

response = client.create_location_hdfs(
    Subdirectory='string',
    NameNodes=[
        {
            'Hostname': 'string',
            'Port': 123
        },
    ],
    BlockSize=123,
    ReplicationFactor=123,
    KmsKeyProviderUri='string',
    QopConfiguration={
        'RpcProtection': 'DISABLED'|'AUTHENTICATION'|'INTEGRITY'|'PRIVACY',
        'DataTransferProtection': 'DISABLED'|'AUTHENTICATION'|'INTEGRITY'|'PRIVACY'
    },
    AuthenticationType='SIMPLE'|'KERBEROS',
    SimpleUser='string',
    KerberosPrincipal='string',
    KerberosKeytab=b'bytes',
    KerberosKrb5Conf=b'bytes',
    AgentArns=[
        'string',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    CmkSecretConfig={
        'SecretArn': 'string',
        'KmsKeyArn': 'string'
    },
    CustomSecretConfig={
        'SecretArn': 'string',
        'SecretAccessRoleArn': 'string'
    }
)
Parameters:
  • Subdirectory (string) – A subdirectory in the HDFS cluster. This subdirectory is used to read data from or write data to the HDFS cluster. If the subdirectory isn’t specified, it will default to /.

  • NameNodes (list) –

    [REQUIRED]

    The NameNode that manages the HDFS namespace. The NameNode performs operations such as opening, closing, and renaming files and directories. The NameNode contains the information to map blocks of data to the DataNodes. You can use only one NameNode.

    • (dict) –

      The NameNode of the Hadoop Distributed File System (HDFS). The NameNode manages the file system’s namespace. The NameNode performs operations such as opening, closing, and renaming files and directories. The NameNode contains the information to map blocks of data to the DataNodes.

      • Hostname (string) – [REQUIRED]

        The hostname of the NameNode in the HDFS cluster. This value is the IP address or Domain Name Service (DNS) name of the NameNode. An agent that’s installed on-premises uses this hostname to communicate with the NameNode in the network.

      • Port (integer) – [REQUIRED]

        The port that the NameNode uses to listen to client requests.

  • BlockSize (integer) – The size of data blocks to write into the HDFS cluster. The block size must be a multiple of 512 bytes. The default block size is 128 mebibytes (MiB).

  • ReplicationFactor (integer) – The number of DataNodes to replicate the data to when writing to the HDFS cluster. By default, data is replicated to three DataNodes.

  • KmsKeyProviderUri (string) – The URI of the HDFS cluster’s Key Management Server (KMS).

  • QopConfiguration (dict) –

    The Quality of Protection (QOP) configuration specifies the Remote Procedure Call (RPC) and data transfer protection settings configured on the Hadoop Distributed File System (HDFS) cluster. If QopConfiguration isn’t specified, RpcProtection and DataTransferProtection default to PRIVACY. If you set RpcProtection or DataTransferProtection, the other parameter assumes the same value.

    • RpcProtection (string) –

      The RPC protection setting configured on the HDFS cluster. This setting corresponds to your hadoop.rpc.protection setting in your core-site.xml file on your Hadoop cluster.

    • DataTransferProtection (string) –

      The data transfer protection setting configured on the HDFS cluster. This setting corresponds to your dfs.data.transfer.protection setting in the hdfs-site.xml file on your Hadoop cluster.

  • AuthenticationType (string) –

    [REQUIRED]

    The type of authentication used to determine the identity of the user.

  • SimpleUser (string) –

    The user name used to identify the client on the host operating system.

    Note

    If SIMPLE is specified for AuthenticationType, this parameter is required.

  • KerberosPrincipal (string) –

    The Kerberos principal with access to the files and folders on the HDFS cluster.

    Note

    If KERBEROS is specified for AuthenticationType, this parameter is required.

  • KerberosKeytab (bytes) –

    The Kerberos key table (keytab) that contains mappings between the defined Kerberos principal and the encrypted keys. You can load the keytab from a file by providing the file’s address.

    Note

    If KERBEROS is specified for AuthenticationType, this parameter is required.

  • KerberosKrb5Conf (bytes) –

    The krb5.conf file that contains the Kerberos configuration information. You can load the krb5.conf file by providing the file’s address. If you’re using the CLI, it performs the base64 encoding for you. Otherwise, provide the base64-encoded text.

    Note

    If KERBEROS is specified for AuthenticationType, this parameter is required.

  • AgentArns (list) –

    [REQUIRED]

    The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your HDFS cluster.

    • (string) –

  • Tags (list) –

    The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

    • (dict) –

      A key-value pair representing a single tag that’s been applied to an Amazon Web Services resource.

      • Key (string) – [REQUIRED]

        The key for an Amazon Web Services resource tag.

      • Value (string) –

        The value for an Amazon Web Services resource tag.

  • CmkSecretConfig (dict) –

    Specifies configuration information for a DataSync-managed secret, which includes the Kerberos keytab that DataSync uses to access a specific Hadoop Distributed File System (HDFS) storage location, with a customer-managed KMS key.

    When you include this parameter as part of a CreateLocationHdfs request, you provide only the KMS key ARN. DataSync uses this KMS key together with the KerberosKeytab you specify for to create a DataSync-managed secret to store the location access credentials.

    Make sure that DataSync has permission to access the KMS key that you specify. For more information, see Using a service-managed secret encrypted with a custom KMS key.

    Note

    You can use either CmkSecretConfig (with KerberosKeytab) or CustomSecretConfig (without KerberosKeytab) to provide credentials for a CreateLocationHdfs request. Do not provide both parameters for the same request.

    • SecretArn (string) –

      Specifies the ARN for the DataSync-managed Secrets Manager secret that that is used to access a specific storage location. This property is generated by DataSync and is read-only. DataSync encrypts this secret with the KMS key that you specify for KmsKeyArn.

    • KmsKeyArn (string) –

      Specifies the ARN for the customer-managed KMS key that DataSync uses to encrypt the DataSync-managed secret stored for SecretArn. DataSync provides this key to Secrets Manager.

  • CustomSecretConfig (dict) –

    Specifies configuration information for a customer-managed Secrets Manager secret where the Kerberos keytab for the HDFS storage location is stored in binary, in Secrets Manager. This configuration includes the secret ARN, and the ARN for an IAM role that provides access to the secret. For more information, see Using a secret that you manage.

    Note

    You can use either CmkSecretConfig (with KerberosKeytab) or CustomSecretConfig (without KerberosKeytab) to provide credentials for a CreateLocationHdfs request. Do not provide both parameters for the same request.

    • SecretArn (string) –

      Specifies the ARN for an Secrets Manager secret.

    • SecretAccessRoleArn (string) –

      Specifies the ARN for the Identity and Access Management role that DataSync uses to access the secret specified for SecretArn.

Return type:

dict

Returns:

Response Syntax

{
    'LocationArn': 'string'
}

Response Structure

  • (dict) –

    • LocationArn (string) –

      The ARN of the source HDFS cluster location that you create.

Exceptions

  • DataSync.Client.exceptions.InvalidRequestException

  • DataSync.Client.exceptions.InternalException