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
Replace `<AWS-account-ID>` with your AWS account ID and `<role-name>` with the IAM role associated with your Amplify Auth setup. Replace `<bucket-name>` with the S3 bucket name.
71
72
72
73
You can refer to [Amazon S3's Policies and Permissions documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) for more ways to customize access to the bucket.
73
74
75
+
<Calloutwarning>
76
+
In order to make calls to your S3 bucket from your application, you must also set up a CORS Policy for your S3 bucket. This applies only to manually-configured S3 buckets. Learn more about [setting up a CORS Policy for your S3 bucket](/[platform]/build-a-backend/storage/extend-s3-resources/#for-manually-configured-s3-resources).
77
+
</Callout>
78
+
74
79
### Specify S3 bucket in Amplify's backend config
75
80
76
-
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.
81
+
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.
77
82
78
83
<Callout>
79
84
@@ -85,7 +90,10 @@ If you specify a custom S3 bucket, no sandbox storage resource will be created.
85
90
86
91
</Callout>
87
92
88
-
```javascript
93
+
Below is an example of configuring the backend to define a custom S3 bucket:
@@ -137,7 +252,7 @@ In addition to manually configuring your storage options, you will also need to
137
252
### Using Amplify configure
138
253
Existing storage resource setup can be accomplished by passing the resource metadata to `Amplify.configure`. This will configure the Amplify Storage client library to interact with the additional resources. It's recommended to add the Amplify configuration step as early as possible in the application lifecycle, ideally at the root entry point.
139
254
140
-
255
+
{/* cSpell:disable */}
141
256
```ts
142
257
import { Amplify } from'aws-amplify';
143
258
@@ -153,22 +268,40 @@ Amplify.configure({
153
268
buckets: {
154
269
'<your-default-bucket-friendly-name>': {
155
270
bucketName: '<your-default-bucket-name>',
156
-
region: '<your-default-bucket-region>'
271
+
region: '<your-default-bucket-region>',
272
+
// required: `paths` is needed to set up access to specific bucket prefixes,
273
+
// and configure access to those prefixes for different user types
274
+
// @ts-expect-error: Amplify backend type issue — https://github.com/aws-amplify/amplify-backend/issues/2569
0 commit comments