3

Is it possible to copy a list of objects or sub-directories in a directory in S3 to another directory in a single transaction?

I need this in java

Nipun
  • 4,119
  • 5
  • 47
  • 83

1 Answers1

1

No, this isn't possible. Individual writes (object creation and copy) are atomic -- they either succeed or they don't -- but S3 is not transactional. Each copy operation is for a single object, so copying multiple objects requires multiple operations, and each one succeeds or fails independently of the others.

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427
  • 1
    Workaround: ZIP all files together and send them as one file to s3. The application can than read and decompress the ZIP file. This step can be done during a deployment (CI/CD) or inside a Java-App. – DLade Oct 01 '22 at 08:27