aws-sdk-java
aws-sdk-java copied to clipboard
Glacier ArchiveTransferManager to take in a InputStream instead of File
Currently com.amazonaws.services.glacier.transfer.ArchiveTransferManager's upload() method and its variants only take in a File for uploading. This limits its use to uploading files which exist in the file system. It would be great if the upload methods take in a InputStream such that the archive can be streamed.
Just to clarify, a use case: I want to archive a lot of files in S3 into Glacier. I want to package the files into a single tar.gz then upload into Glacier. I would like to use as little extra disk space as possible while doing so. Currently I am limited to using low-level API only.
Suggestion : Why not try using Bucket Lifecycle Configuration rules to archive the S3 objects to glacier ?. S3 also provides APIs to load data back from Glacier.
There are several drawbacks of lifecycles which makes it hard for me to use in my use case.
- I cannot process files in S3 before archiving to Glacier (ex. tar and compress)
- I am limited to defining lifecycle rules using prefixes. (ex. I cannot do something like /some/path/in/middle/)
- Lifecycle rule is something that is defined at the bucket level. Cannot do something like a one-off archive operation without affecting policies bucket level.
My team and I are looking into how we could leverage lifecycles for our uses, but I still think this is a useful feature for Glacier transfer manager:
- What if the source data is not S3? Maybe some datacenter?
- Why not keep the transfer manager API somewhat consistent with S3 transfer manager? (which takes in the PutObjectRequest, which allows streams).
Thanks for the explanation. I will add this to our feature request back log.
We love accepting pull requests from our customers. If you wish to submit a PR for this, I would be happy to take a look at it.
+1 for InputStream upload
This is just a quick update letting you know that the SDK team has reviewed the feature request list for V1 and this one looks like a great candidate for a community PR, which we’ll help merge in and support.
We don't have plans to support this in v1 before going into Maintenance Mode, so I'll go ahead and close this feature request.
Reference:
- Announcing end-of-support for AWS SDK for Java v1.x effective December 31, 2025 - blog post
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.