fix: sqs configuration for aws sdk v3

This commit is contained in:
Karol Sójko 2023-01-30 12:49:14 +01:00
parent 8216fe5e36
commit b54c331bef
No known key found for this signature in database
GPG key ID: D966F68E8A92F649
10 changed files with 31 additions and 10 deletions

View file

@ -13,6 +13,10 @@ echo "Bundling and building local docker image for service: $SERVICE"
rm -rf $TMPDIR/bundle-$SERVICE/
mkdir -p $TMPDIR/bundle-$SERVICE
yearn clean
yarn workspace @standardnotes/$SERVICE-server build
yarn workspace @standardnotes/$SERVICE-server bundle --no-compress --output-directory $TMPDIR/bundle-$SERVICE
docker build $TMPDIR/bundle-$SERVICE -f $TMPDIR/bundle-$SERVICE/packages/$SERVICE/Dockerfile -t standardnotes/$SERVICE:local

View file

@ -114,9 +114,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -260,7 +260,6 @@ export class ContainerConfigLoader {
if (env.get('SNS_TOPIC_ARN', true)) {
const snsConfig: SNSClientConfig = {
apiVersion: 'latest',
region: env.get('SNS_AWS_REGION', true),
}
if (env.get('SNS_ENDPOINT', true)) {
@ -277,9 +276,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -30,9 +30,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -125,9 +125,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -86,9 +86,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -94,9 +94,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -146,9 +146,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -76,9 +76,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),

View file

@ -104,9 +104,11 @@ export class ContainerConfigLoader {
if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = {
apiVersion: 'latest',
region: env.get('SQS_AWS_REGION', true),
}
if (env.get('SQS_ENDPOINT', true)) {
sqsConfig.endpoint = env.get('SQS_ENDPOINT', true)
}
if (env.get('SQS_ACCESS_KEY_ID', true) && env.get('SQS_SECRET_ACCESS_KEY', true)) {
sqsConfig.credentials = {
accessKeyId: env.get('SQS_ACCESS_KEY_ID', true),