Skip to content

Commit 7b1602a

Browse files
committed
chore: add copy example for expected bucket owner
1 parent 5b4b2c1 commit 7b1602a

File tree

1 file changed

+5
-3
lines changed
  • src/pages/[platform]/build-a-backend/storage/copy-files

1 file changed

+5
-3
lines changed

src/pages/[platform]/build-a-backend/storage/copy-files/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ const copyFile = async () => {
8686
path: 'album/2024/1.jpg',
8787
// Specify a target bucket using name assigned in Amplify Backend
8888
// or bucket name from console and associated region
89-
bucket: 'assignedNameInAmplifyBackend'
89+
bucket: 'assignedNameInAmplifyBackend',
90+
expectedBucketOwner: '123456789012'
9091
},
9192
destination: {
9293
path: 'shared/2024/1.jpg',
@@ -95,7 +96,8 @@ const copyFile = async () => {
9596
bucket: {
9697
bucketName: 'generated-second-bucket-name',
9798
region: 'us-east-2'
98-
}
99+
},
100+
expectedBucketOwner: '123456789013'
99101
}
100102
});
101103
} catch (error) {
@@ -116,7 +118,7 @@ Option | Type | Default | Description |
116118
| bucket | string \| <br />\{ bucketName: string;<br/> region: string; \} | Default bucket and region from Amplify configuration | A string representing the target bucket's assigned name in Amplify Backend or an object specifying the bucket name and region from the console.<br/><br/>Read more at [Configure additional storage buckets](/[platform]/build-a-backend/storage/set-up-storage/#configure-additional-storage-buckets). |
117119
| eTag | string | Optional | The copy **source object** entity tag (ETag) value. Only Copies the object if its ETag matches the specified tag. |
118120
| notModifiedSince | Date | Optional | Copies the **source object** if it hasn't been modified since the specified time. <br /><br/> **This is evaluated only when `eTag` is NOT supplied**|
119-
| expectedBucketOwner | string | Optional | The account ID that owns source or destination bucket. |
121+
| expectedBucketOwner | string | Optional | `source.expectedBucketOwner`: The account ID that owns the source bucket. <br /><br /> `destination.expectedBucketOwner`: The account ID that owns the destination bucket. |
120122

121123
</InlineFilter>
122124

0 commit comments

Comments
 (0)