https://docs.aws.amazon.com/ja_jp/AmazonS3/latest/dev/HLuploadFileJava.html Describes how to upload files to S3.
However, if you do not call shutdownNow at the end of the process here, it seems that s3Client threads may continue to remain. (Maybe it depends on the SDK version.)
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
.withRegion(clientRegion)
.withCredentials(new ProfileCredentialsProvider())
.build();
TransferManager tm = TransferManagerBuilder.standard()
.withS3Client(s3Client)
.build();
// TransferManager processes all transfers asynchronously,
// so this call returns immediately.
Upload upload = tm.upload(bucketName, keyName, new File(filePath));
System.out.println("Object upload started");
// Optionally, wait for the upload to finish before continuing.
upload.waitForCompletion();
System.out.println("Object upload complete");
// You need to close the transfer manager as follows. tm.shutdownNow();
reference
https://www.tcmobile.jp/dev_blog/programming/%E3%80%90java%E3%80%91cse%E3%83%9E%E3%83%AB%E3%83%81%E3%83%91%E3%83%BC%E3%83%88%E3%82%A2%E3%83%83%E3%83%97%E3%83%AD%E3%83%BC%E3%83%89%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%80%81s3%E3%81%B8/