You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/storage/use-with-custom-s3/index.mdx
+6-9
Original file line number
Diff line number
Diff line change
@@ -83,11 +83,7 @@ In order to make calls to your manually configured S3 bucket from your applicati
83
83
Next, use the `addOutput` method from the backend definition object to define a custom S3 bucket by specifying the name and region of the bucket in your `amplify/backend.ts` file. You must also set up the appropriate resources and IAM policies to be attached to the backend.
84
84
85
85
<Callout>
86
-
87
-
**Important:** You cannot use both a storage backend configured through Amplify and a custom S3 bucket at the same time.
88
-
89
-
If you specify a custom S3 bucket, no sandbox storage resource will be created. The provided custom S3 bucket will be used, even in the sandbox environment.
90
-
86
+
**Important:** You can use a storage backend configured through Amplify and a custom S3 bucket at the same time using this method. However, the Amplify-configured storage will be used as the default bucket, and automatically provide its name and region to `addOutput`.
91
87
</Callout>
92
88
93
89
Below are several examples of configuring the backend to define a custom S3 bucket:
Below is an example of expanding the original backend object to have an `admin/` folder that authenticated users can read, but only users belonging to the "admin" user group can manage:
253
+
Below is an example of expanding the original backend object with user group permissions. Here, any authenticated users can read from `admin/` and `public/` and authenticated users belonging to the "admin" user group can only manage`admin/`:
Amplify allows scoping file access to individual users via the user's identity ID. To specify the user's identity ID, you can use the token `${cognito-identity.amazonaws.com:sub}`.
348
-
345
+
</Callout>
349
346
Below is an example of expanding the original backend object to define read access for guests to the `public/` folder, as well as defining a `protected/` folder where anyone can view uploaded files, but only the file owner can modify/delete them:
350
347
351
348
{/* cSpell:disable */}
@@ -391,7 +388,7 @@ backend.addOutput({
391
388
guest: ["get", "list"],
392
389
authenticated: ["get", "list"],
393
390
},
394
-
// allow owners to get/modify/delete their own files in assigned subfolder
391
+
// allow owners to read, write and delete their own files in assigned subfolder
The custom authorization rules defined in the examples are able to be combined, and follow the same rules used when working with Amplify-defined storage. For more information about the access types and access definition rules supported by Amplify, please refer to our documentation on [customizing authorization rules](/[platform]/build-a-backend/storage/authorization/).
503
+
The custom authorization rules defined in the examples can be combined, and follow the same rules as Amplify-defined storage. Please refer to our documentation on [customizing authorization rules](/[platform]/build-a-backend/storage/authorization/) for more information.
0 commit comments