Skip to content

Commit

Permalink
[JS] Update migration docs to use path (#7143)
Browse files Browse the repository at this point in the history
* update to use path in migration guide

* Apply suggestions from code review

Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com>

---------

Co-authored-by: Jim Blanchard <jim.l.blanchard@gmail.com>
  • Loading branch information
ashika112 and jimblanc committed Apr 3, 2024
1 parent a7b8119 commit f4450f4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ import common_configureaccess from '/src/fragments/lib/storage/native_common/con

<InlineFilter filters={['javascript', 'react-native', 'angular', 'nextjs', 'react', 'vue']}>

<Callout warning>
We recommend using the new [Amplify Gen2](https://docs.amplify.aws/gen2/build-a-backend/storage/) experience when defining file access permissions as it offers a more flexible approach to customize access to files.

Note: `accessLevel` parameter is deprecated and maybe removed in next major version.
</Callout>

Storage module can manage files with three different access levels; `guest`, `protected` and `private`. The Amplify CLI configures three different access levels on the storage bucket: guest, protected and private. When you run `amplify add storage`, the CLI will configure appropriate IAM policies on the bucket using a Cognito identity pool Role. You will have the option of adding CRUD (Create/Update, Read and Delete) based permissions as well, so that Authenticated and Guest users will be granted limited permissions within these levels.

If you had previously enabled user sign-in by running `amplify add auth` in your project, the policies will be connected to an `Authenticated Role` of the identity pool which has scoped permission to the objects in the bucket for each user identity. If you haven't configured user sign-in, then an `Unauthenticated Role` will be assigned for each unique user/device combination, which still has scoped permissions to just their objects.
Expand Down Expand Up @@ -84,9 +90,9 @@ import { getUrl } from 'aws-amplify/storage';
await getUrl({ key: 'welcome.png' }); // Get welcome.png in public space
```

## Customization
## Customization (Deprecated)

### Customize Object Key Path
### Customize Object Key Path (Deprecated)

You can customize your key path by defining a prefix resolver:

Expand Down
Loading

0 comments on commit f4450f4

Please sign in to comment.