aws-samples / aws-samples/image-optimization

Deploy to cross regions S3 got error IllegalLocationConstraintException

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.