Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions config/custom-environment-variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ firehose:
s3:
region: RTCSTATS_S3_AWS_REGION
bucket: RTCSTATS_S3_BUCKET
endpoint: RTCSTATS_S3_ENDPOINT

dynamo:
tableName: RTCSTATS_METADATA_TABLE
endpoint: RTCSTATS_DYNAMODB_ENDPOINT

webhooks:
apiEndpoint: RTCSTATS_WEBHOOK_ENDPOINT
Expand Down
1 change: 1 addition & 0 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ s3:
useIAMAuth:
# Default value is 2 days
signedLinkExpirationSec: 172800
endpoint:

firehose:
accessKeyId:
Expand Down
11 changes: 5 additions & 6 deletions src/store/S3Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class S3Manager {
* @param {*} config - Configuration object that contains S3 settings such as region, bucket, etc.
*/
constructor(config) {
const { region, useIAMAuth, bucket, signedLinkExpirationSec } = config;
const { region, useIAMAuth, bucket, signedLinkExpirationSec, endpoint } = config;

assert(region);
assert(bucket);
Expand All @@ -27,11 +27,9 @@ class S3Manager {
AWS.config = config;
}

this.s3bucket = new AWS.S3({
params: {
Bucket: bucket
}
});
// Use endpoint for local S3 (e.g., MinIO or LocalStack).
// Falls back to default AWS S3 if no endpoint is specified.
this.s3bucket = new AWS.S3(endpoint ? { endpoint } : {});

this.bucket = bucket;
this.signedLinkExpirationSec = signedLinkExpirationSec;
Expand All @@ -50,6 +48,7 @@ class S3Manager {
const compressedStream = readStream.pipe(gzipStream);

return this.s3bucket.upload({
Bucket: this.bucket,
Key: key,
Body: compressedStream
}).promise();
Expand Down