File transfer from FSx to S3 using a lambda function in Java

0

I am using an Amazon Lambda function with an SMBClient in Java to connect and list the files in my FileShare System which is Amazon Fsx. I want to explore transferring the files listed to Amazon S3. Is there a way to do this by adding on the code? AWS Data Sync is impossible due to restrictions of my organisation. Will appreciate any help, thank you!!

My current code in Lambda is like this to connect to FSx:

//Configuration to adjust timeout SMBConfig config = SmbConfig.builder() .withDialects(SMB2Dialect.SMB_3_1_1) .withTimeout(900000,TimeUnit.MILLISECONDS) .withSoTimeout(20000,TimeUnit.MILLISECONDS) .withEncryptData(true) .withDfsEnabled(true) .build();

//Authentication AuthenticationContext context = new AuthenticationContext("USERNAME","PASSWORD".toCharArray(), "DOMAIN");

try (SMBClient smbClient = new SMBClient(config);
     Connection connection = smbClient.connect("SERVERNAME")) 
     Session session = connection.authenticate(context);

    // Connecting to Shared File System
    DiskShare share = (DiskShare) session.connectShare("SHARENAME")) {
    List<FileIdBothDirectoryInformation> fileList = share.list("FOLDER");
    System.out.println("File list:");
    fileList.forEach(f -> System.out.printLn(f.getFileName()));
    }
K
gefragt vor 2 Monaten107 Aufrufe
1 Antwort
0
psp
beantwortet vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen