File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
api/integrations/event/sqs Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ export class SqsController extends EventController implements EventControllerInt
2828 accessKeyId : awsConfig . ACCESS_KEY_ID ,
2929 secretAccessKey : awsConfig . SECRET_ACCESS_KEY ,
3030 } ,
31-
3231 region : awsConfig . REGION ,
32+ endpoint : awsConfig . ENDPOINT || undefined ,
3333 } ) ;
3434
3535 this . logger . info ( 'SQS initialized' ) ;
@@ -126,7 +126,9 @@ export class SqsController extends EventController implements EventControllerInt
126126 ? 'singlequeue'
127127 : `${ event . replace ( '.' , '_' ) . toLowerCase ( ) } ` ;
128128 const queueName = `${ prefixName } _${ eventFormatted } .fifo` ;
129- const sqsUrl = `https://sqs.${ sqsConfig . REGION } .amazonaws.com/${ sqsConfig . ACCOUNT_ID } /${ queueName } ` ;
129+ const sqsUrl = sqsConfig . ENDPOINT
130+ ? `${ sqsConfig . ENDPOINT . replace ( / \/ $ / , '' ) } /${ sqsConfig . ACCOUNT_ID } /${ queueName } `
131+ : `https://sqs.${ sqsConfig . REGION } .amazonaws.com/${ sqsConfig . ACCOUNT_ID } /${ queueName } ` ;
130132
131133 const message = {
132134 ...( extra ?? { } ) ,
Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ export type Sqs = {
121121 SECRET_ACCESS_KEY : string ;
122122 ACCOUNT_ID : string ;
123123 REGION : string ;
124+ ENDPOINT : string ;
124125 MAX_PAYLOAD_SIZE : number ;
125126 EVENTS : {
126127 APPLICATION_STARTUP : boolean ;
@@ -585,6 +586,7 @@ export class ConfigService {
585586 SECRET_ACCESS_KEY : process . env . SQS_SECRET_ACCESS_KEY || '' ,
586587 ACCOUNT_ID : process . env . SQS_ACCOUNT_ID || '' ,
587588 REGION : process . env . SQS_REGION || '' ,
589+ ENDPOINT : process . env . SQS_ENDPOINT || '' ,
588590 MAX_PAYLOAD_SIZE : Number . parseInt ( process . env . SQS_MAX_PAYLOAD_SIZE ?? '1048576' ) ,
589591 EVENTS : {
590592 APPLICATION_STARTUP : process . env ?. SQS_GLOBAL_APPLICATION_STARTUP === 'true' ,
You can’t perform that action at this time.
0 commit comments