createLocationHdfs method
- required List<
String> agentArns, - required HdfsAuthenticationType authenticationType,
- required List<
HdfsNameNode> nameNodes, - int? blockSize,
- CmkSecretConfig? cmkSecretConfig,
- CustomSecretConfig? customSecretConfig,
- Uint8List? kerberosKeytab,
- Uint8List? kerberosKrb5Conf,
- String? kerberosPrincipal,
- String? kmsKeyProviderUri,
- QopConfiguration? qopConfiguration,
- int? replicationFactor,
- String? simpleUser,
- String? subdirectory,
- List<
TagListEntry> ? tags,
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.
May throw InternalException.
May throw InvalidRequestException.
Parameter agentArns :
The Amazon Resource Names (ARNs) of the DataSync agents that can connect
to your HDFS cluster.
Parameter authenticationType :
The type of authentication used to determine the identity of the user.
Parameter nameNodes :
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.
Parameter blockSize :
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).
Parameter cmkSecretConfig :
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.
Parameter customSecretConfig :
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.
Parameter kerberosKeytab :
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.
Parameter kerberosKrb5Conf :
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.
Parameter kerberosPrincipal :
The Kerberos principal with access to the files and folders on the HDFS
cluster.
Parameter kmsKeyProviderUri :
The URI of the HDFS cluster's Key Management Server (KMS).
Parameter qopConfiguration :
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.
Parameter replicationFactor :
The number of DataNodes to replicate the data to when writing to the HDFS
cluster. By default, data is replicated to three DataNodes.
Parameter simpleUser :
The user name used to identify the client on the host operating system.
Parameter subdirectory :
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 /.
Parameter tags :
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.
Implementation
Future<CreateLocationHdfsResponse> createLocationHdfs({
required List<String> agentArns,
required HdfsAuthenticationType authenticationType,
required List<HdfsNameNode> nameNodes,
int? blockSize,
CmkSecretConfig? cmkSecretConfig,
CustomSecretConfig? customSecretConfig,
Uint8List? kerberosKeytab,
Uint8List? kerberosKrb5Conf,
String? kerberosPrincipal,
String? kmsKeyProviderUri,
QopConfiguration? qopConfiguration,
int? replicationFactor,
String? simpleUser,
String? subdirectory,
List<TagListEntry>? tags,
}) async {
_s.validateNumRange(
'blockSize',
blockSize,
1048576,
1073741824,
);
_s.validateNumRange(
'replicationFactor',
replicationFactor,
1,
512,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'FmrsService.CreateLocationHdfs'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AgentArns': agentArns,
'AuthenticationType': authenticationType.value,
'NameNodes': nameNodes,
if (blockSize != null) 'BlockSize': blockSize,
if (cmkSecretConfig != null) 'CmkSecretConfig': cmkSecretConfig,
if (customSecretConfig != null)
'CustomSecretConfig': customSecretConfig,
if (kerberosKeytab != null)
'KerberosKeytab': base64Encode(kerberosKeytab),
if (kerberosKrb5Conf != null)
'KerberosKrb5Conf': base64Encode(kerberosKrb5Conf),
if (kerberosPrincipal != null) 'KerberosPrincipal': kerberosPrincipal,
if (kmsKeyProviderUri != null) 'KmsKeyProviderUri': kmsKeyProviderUri,
if (qopConfiguration != null) 'QopConfiguration': qopConfiguration,
if (replicationFactor != null) 'ReplicationFactor': replicationFactor,
if (simpleUser != null) 'SimpleUser': simpleUser,
if (subdirectory != null) 'Subdirectory': subdirectory,
if (tags != null) 'Tags': tags,
},
);
return CreateLocationHdfsResponse.fromJson(jsonResponse.body);
}