Skip to content

Commit f0cbbba

Browse files
address feedback
1 parent 30b25c1 commit f0cbbba

File tree

1 file changed

+6
-9
lines changed
  • src/pages/[platform]/build-a-backend/storage/use-with-custom-s3

1 file changed

+6
-9
lines changed

Diff for: src/pages/[platform]/build-a-backend/storage/use-with-custom-s3/index.mdx

+6-9
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ In order to make calls to your manually configured S3 bucket from your applicati
8383
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.
8484

8585
<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`.
9187
</Callout>
9288

9389
Below are several examples of configuring the backend to define a custom S3 bucket:
@@ -254,7 +250,7 @@ backend.auth.resources.authenticatedUserIamRole.attachInlinePolicy(authPolicy);
254250
```
255251
</Block>
256252
<Block name="User Groups">
257-
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/`:
258254
{/* cSpell:disable */}
259255
```ts title="amplify/backend.ts"
260256
import { defineBackend } from '@aws-amplify/backend';
@@ -344,8 +340,9 @@ backend.auth.resources.groups["admin"].role.attachInlinePolicy(adminPolicy);
344340
{/* cSpell:enable */}
345341
</Block>
346342
<Block name="Owners">
343+
<Callout>
347344
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>
349346
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:
350347

351348
{/* cSpell:disable */}
@@ -391,7 +388,7 @@ backend.addOutput({
391388
guest: ["get", "list"],
392389
authenticated: ["get", "list"],
393390
},
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
395392
"protected/${cognito-identity.amazonaws.com:sub}/*": {
396393
entityidentity: ["get", "list", "write", "delete"]
397394
}
@@ -503,7 +500,7 @@ backend.auth.resources.authenticatedUserIamRole.attachInlinePolicy(authPolicy);
503500
</BlockSwitcher>
504501

505502
<Callout>
506-
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.
507504
</Callout>
508505

509506
<InlineFilter filters={["javascript", "nextjs", "react", "angular", "vue", "react-native", "android", "swift"]}>

0 commit comments

Comments
 (0)