Skip to content

fix(js/rn): modified storage 'use existing AWS resources' page #5178

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

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/fragments/lib/storage/js/existing-resources.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
If you are using the Amplify CLI, an existing Amazon S3 bucket can be used with the Amplify Libraries by running:

```bash
amplify import storage
```

For more details, see how to [Use an existing S3 bucket or DynamoDB table](/cli/storage/import).

If you are not using the Amplify CLI, an existing Amazon S3 bucket can be used by adding it to your `Amplify.configure` statement.

<Callout warning>
When you are not using Amplify CLI, adding existing Amazon S3 bucket to your application may require configuring bucket access permissions. e.g. Enabling read/write access to the cognito user pool that you are using with the Amplify Auth category.
</Callout>

```js
Amplify.configure({
aws_user_files_s3_bucket_region: 'us-east-1', // (required) - Amazon S3 bucket region
aws_user_files_s3_bucket: 'testappa321fb103f1f2ae6a4d25d8cd2161728123152-dev' // (required) - Amazon S3 bucket URI
});
```

- **aws_user_files_s3_bucket**: Name of the bucket to use for storage
- **aws_user_files_s3_bucket_region**: AWS Region where the bucket is provisioned (e.g. _us-east-1_)

You can also configure the resources on a scoped level by [following the steps shown here](/lib/client-configuration/configuring-amplify-categories/#storage-amazon-s3).

Note that before you can add an AWS resource to your application, the application must have the Amplify libraries installed. If you need to perform this step, see [Install Amplify Libraries](/lib/project-setup/create-application#n2-install-amplify-libraries).
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ export const meta = {
description: `Configure the Amplify Libraries to use an existing Amazon S3 bucket by referencing it in your configuration.`
};

import js0 from '/src/fragments/lib/storage/existing-resources.mdx';
import js0 from '/src/fragments/lib/storage/js/existing-resources.mdx';

<Fragments fragments={{ js: js0 }} />

import reactnative0 from '/src/fragments/lib/storage/existing-resources.mdx';
import reactnative0 from '/src/fragments/lib/storage/js/existing-resources.mdx';

<Fragments fragments={{ 'react-native': reactnative0 }} />

Expand Down