Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/open-next/src/overrides/imageLoader/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FatalError } from "utils/error";

import { awsLogger } from "../../adapters/logger";

const { BUCKET_NAME, BUCKET_KEY_PREFIX } = process.env;
const { BUCKET_NAME, BUCKET_KEY_PREFIX, S3_REGION } = process.env;

function ensureBucketExists() {
if (!BUCKET_NAME) {
Expand All @@ -17,7 +17,7 @@ function ensureBucketExists() {
const s3Loader: ImageLoader = {
name: "s3",
load: async (key: string) => {
const s3Client = new S3Client({ logger: awsLogger });
const s3Client = new S3Client({ region: S3_REGION || 'us-east-1', logger: awsLogger });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is deployed on lambda, the region is set there. We should absolutely not set it to us-east-1


ensureBucketExists();
const keyPrefix = BUCKET_KEY_PREFIX?.replace(/^\/|\/$/g, "");
Expand Down