Skip to content

Commit cd3da15

Browse files
author
Bannon Tanner
authored
modified storage 'use existing AWS resources' page to have accurate information for JS/RN (#5178)
1 parent fb04301 commit cd3da15

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
If you are using the Amplify CLI, an existing Amazon S3 bucket can be used with the Amplify Libraries by running:
2+
3+
```bash
4+
amplify import storage
5+
```
6+
7+
For more details, see how to [Use an existing S3 bucket or DynamoDB table](/cli/storage/import).
8+
9+
If you are not using the Amplify CLI, an existing Amazon S3 bucket can be used by adding it to your `Amplify.configure` statement.
10+
11+
<Callout warning>
12+
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.
13+
</Callout>
14+
15+
```js
16+
Amplify.configure({
17+
aws_user_files_s3_bucket_region: 'us-east-1', // (required) - Amazon S3 bucket region
18+
aws_user_files_s3_bucket: 'testappa321fb103f1f2ae6a4d25d8cd2161728123152-dev' // (required) - Amazon S3 bucket URI
19+
});
20+
```
21+
22+
- **aws_user_files_s3_bucket**: Name of the bucket to use for storage
23+
- **aws_user_files_s3_bucket_region**: AWS Region where the bucket is provisioned (e.g. _us-east-1_)
24+
25+
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).
26+
27+
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).

src/pages/lib/storage/existing-resources/q/platform/[platform].mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ export const meta = {
33
description: `Configure the Amplify Libraries to use an existing Amazon S3 bucket by referencing it in your configuration.`
44
};
55

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

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

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

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

0 commit comments

Comments
 (0)