amplify-android icon indicating copy to clipboard operation
amplify-android copied to clipboard

feat(storage): Add support to define the S3 Storage Class

Open amcofi opened this issue 1 year ago • 1 comments

Add support to define the S3 Storage Class when uploading files or streams. Implementation is based on the existing support Server Side Encryption.

See also: https://aws.amazon.com/s3/storage-classes

  • [x] PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:

How did you test these changes? I didn't see any tests for related functionality. I tested the storage class is set correctly when uploading to my S3 bucket from my own application.

val options = AWSS3StorageUploadInputStreamOptions.builder()
    .storageClass(aws.sdk.kotlin.services.s3.model.StorageClass.GlacierIr)
    .build()

Amplify.Storage.uploadInputStream(
    StoragePath.fromString(key),
    inputStream,
    options,
    { result -> ... },
    { error -> ... }
)

Documentation update required?

  • [x] No
  • [ ] Yes (Please include a PR link for the documentation update)

General Checklist

  • [ ] Added Unit Tests
  • [ ] Added Integration Tests
  • [x] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

amcofi avatar Jun 28 '24 11:06 amcofi

Hi @amcofi,

Thank you for your contribution. We will take a look at the PR and get back to you!

tylerjroach avatar Jun 28 '24 15:06 tylerjroach