Allow endpoint to be configured for sqs event publisher

Signed-off-by: Scott Guymer <scott.guymer@philips.com>
This commit is contained in:
Scott Guymer
2023-04-28 16:36:35 +02:00
parent cb31ea1da1
commit 2c5661f389
3 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-events-backend-module-aws-sqs': minor
---
Allow endpoint configuration for sqs, enabling use of localstack for testing.
@@ -68,7 +68,11 @@ export class AwsSqsConsumingEventPublisher implements EventPublisher {
VisibilityTimeout: config.visibilityTimeout?.as('seconds'),
WaitTimeSeconds: config.pollingWaitTime.as('seconds'),
};
this.sqs = new SQSClient({ region: config.region });
this.sqs = new SQSClient({
region: config.region,
endpoint: config.endpoint,
});
this.queueUrl = config.queueUrl;
this.taskTimeoutSeconds = config.timeout.as('seconds');
@@ -31,6 +31,7 @@ export interface AwsSqsEventSourceConfig {
topic: string;
visibilityTimeout?: Duration;
waitTimeAfterEmptyReceive: Duration;
endpoint?: string;
}
// TODO(pjungermann): validation could be improved similar to `convertToHumanDuration` at @backstage/backend-tasks