aws-samples / aws-samples/image-optimization
Deploy to cross regions S3 got error IllegalLocationConstraintException
- Dominant language
- TypeScript
- Stars
- 276
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Error due to S3 region constraints
```
INFO APPLICATION ERROR Error downloading original image
INFO IllegalLocationConstraintException: The ap-southeast-7 location constraint is incompatible for the region specific endpoint this request was sent to.
at throwDefaultError (/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/smithy-client/dist-cjs/index.js:422:20)
at /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/smithy-client/dist-cjs/index.js:431:5
at de_CommandError (/var/runtime/node_modules/@aws-sdk/client-s3/dist-cjs/index.js:5202:14)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-serde/dist-cjs/index.js:36:20
at async /var/runtime/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:488:18
at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-retry/dist-cjs/index.js:312:38
at async /var/runtime/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:110:22
at async /var/runtime/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:137:14
```
..
Since Lambda Webhook URL is not available in `ap-southeast-7` yet
I have to deploy to `ap-southeast-1`, but the code assume S3 to be in the same region
I hard code my S3 Region and it work now.
I haven't check how to link this with cdk deploy et since i don't have knowledge much
just share here so maybe someone can quickly fix the lambda script
Contributor guide
Assessment
This issue has not been assessed yet.