-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable AWS S3 Transfer acceleration for Amplify SDK #3380
Comments
Hi @Ankish! Both Amplify and the AWS SDK for iOS support transfer acceleration. Amplify support was introduced in version 2.15.1, while the SDK has had it since 2.4.3. As it seems you're using Amplify, you just need to set let options = StorageUploadFileRequest.Options(
accessLevel: .private,
targetIdentityId: nil,
metadata: [
Utils.createTimeStampKey : "(createTime)"
],
contentType: nil,
pluginOptions: [
"useAccelerateEndpoint": true
]
)
let task = Amplify.Storage.uploadFile(
key: videoId,
local: localURL,
options: options
) Note that this is only available in Amplify v2. If you do not wish to upgrade and want to use the iOS SDK instead, you can follow this instructions. |
The Use transfer acceleration section has been added to the Amplify Documentation for Swift site. |
Confirming, This is not supported in Amplify V1 ? I am using V1 and updated with above code and this does not throw any error. |
Yes, this is only supported in Amplify v2. |
The issue now is Amplify SPM and AWS SPM both does not work in same project, there is an open issue already on AWS.
This is how we initialise the configuration:
|
@ruisebas : Help would be greatly appreciated. I know there are samples but I am not able to find a AWS replacement for my above amplify 1.0 code. |
Hi @Ankish! First of all, to avoid any potential confusion for people finding this issue, let's clarify this statement:
This is incorrect. You cannot add Amplify v2 and the AWS SDK for iOS to the same project. But you can totally use Amplify v1 through SPM, which works fine with the AWS SDK for iOS. Regarding your question, as Amplify v1 uses the To upload using your own 1. A
|
State your question
Enable AWS S3 Transfer acceleration for Amplify SDK request or provide a alternative way to implement the same with AWS SDK.
Which AWS Services are you utilizing?
AWS / Amplify / iOS SDK
Provide code snippets (if applicable)
Currently using Amplify to upload file:
let option = StorageUploadFileRequest.Options(accessLevel: StorageAccessLevel.private, targetIdentityId: nil,
metadata: [Utils.createTimeStampKey : "(createTime)"], contentType: nil, pluginOptions:nil)
Amplify.Storage.uploadFile(key: videoId, local: localURL, options: option, progressListener: { progress
Environment(please complete the following information):
Device Information (please complete the following information):
How can I migrate this to use with S3 Acceleration code with access level and metadata information ?
If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.
The text was updated successfully, but these errors were encountered: